Skip to content

Instantly share code, notes, and snippets.

View cmac1000's full-sized avatar

Chris MacDonald cmac1000

View GitHub Profile
@cmac1000
cmac1000 / null.js
Last active June 10, 2016 12:37
null.js
> var options = null;
undefined
> options
null
> options['developerCredentials']
TypeError: Cannot read property 'developerCredentials' of null
at repl:1:8
at REPLServer.defaultEval (repl.js:164:27)
at bound (domain.js:280:14)
at REPLServer.runBound [as eval] (domain.js:293:12)
{
"env": {
"browser": true,
},
"parser": "babel-eslint",
"plugins": [],
// setting all these to false for now, mostly useful for es6
"ecmaFeatures": {
"arrowFunctions": false,
"binaryLiterals": false,
def is_a_cat(animal_name):
if animal_name == 'cat':
return True
else:
return False
def lycanthropize(animal_name):
return "were-" + animal_name
var ioClient = require('socket.io-client')
var should = require('should');
var chai = require('chai');
var options ={
transports: ['websocket'],
'force new connection': true,
'reconnection delay' : 0,
'reopen delay' : 0
};
for city in db.cities.find():
if "Metropolitan Division" in city['censusName']:
db.cities.remove(city)
$ grep "41860" cities.py;
{"censusCBSACode":"41860","censusName":"Oakland-Fremont-Hayward, CA Metropolitan Division"},
{"censusCBSACode":"41860","censusName":"San Francisco-San Mateo-Redwood City, CA Metropolitan Division"},
{"censusCBSACode":"41860","censusName":"San Francisco-Oakland-Fremont, CA Metropolitan Statistical Area"},
$ grep "31100" cities.py;
{"censusCBSACode":"31100","censusName":"Los Angeles-Long Beach-Glendale, CA Metropolitan Division"},
{"censusCBSACode":"31100","censusName":"Santa Ana-Anaheim-Irvine, CA Metropolitan Division"},
{"censusCBSACode":"31100","censusName":"Los Angeles-Long Beach-Santa Ana, CA Metropolitan Statistical Area"},
$ grep "37980" cities.py;
{"censusCBSACode":"37980","censusName":"Camden, NJ Metropolitan Division"},
>>> from cities import citiesToInsert
>>> for city in citiesToInsert:
... db.cities.insert(city)
...
ObjectId('51313de546c19709f3ce00eb')
ObjectId('51313de546c19709f3ce00ec')
ObjectId('51313de546c19709f3ce00ed')
ObjectId('51313de546c19709f3ce00ee')
ObjectId('51313de546c19709f3ce00ef')
ObjectId('51313de546c19709f3ce00f0')