Skip to content

Instantly share code, notes, and snippets.

Avatar

Chris MacDonald cmac1000

View GitHub Profile
View 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)
View gist:09ff1feb041adb7d3f5e
{
"env": {
"browser": true,
},
"parser": "babel-eslint",
"plugins": [],
// setting all these to false for now, mostly useful for es6
"ecmaFeatures": {
"arrowFunctions": false,
"binaryLiterals": false,
View gist:265d3bc1add8dd5e404e
def is_a_cat(animal_name):
if animal_name == 'cat':
return True
else:
return False
def lycanthropize(animal_name):
return "were-" + animal_name
View gist:d2029989ef87dbc4da3c
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
};
View gist:5081782
for city in db.cities.find():
if "Metropolitan Division" in city['censusName']:
db.cities.remove(city)
View gist:5078678
$ 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"},
View gist:5068926
>>> from cities import citiesToInsert
>>> for city in citiesToInsert:
... db.cities.insert(city)
...
ObjectId('51313de546c19709f3ce00eb')
ObjectId('51313de546c19709f3ce00ec')
ObjectId('51313de546c19709f3ce00ed')
ObjectId('51313de546c19709f3ce00ee')
ObjectId('51313de546c19709f3ce00ef')
ObjectId('51313de546c19709f3ce00f0')