sudo curl "http://phildawson.co.uk/ssh-copy-id" -o /usr/bin/ssh-copy-id
sudo chmod +x /usr/bin/ssh-copy-id
ssh-copy-id -i ~/.ssh/id_rsa.pub user@host
ssh-copy-id -i ~/.ssh/id_rsa.pub "user@host -p 8129"
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var fs = require('fs'); | |
var readline = require('readline'); | |
var stream = require('stream'); | |
var instream = fs.createReadStream('test.txt', 'utf8'); | |
var outstream = new stream; | |
var rl = readline.createInterface(instream, outstream); | |
var obj = {} | |
rl.on('line', function (line) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git checkout --track origin/daves_branch |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ "keys": ["alt+super+t"], "command": "insert_snippet", "args": {"name": "Packages/User/mako-translate.sublime-snippet"} } | |
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
my_dict.update((x, y*2) for x, y in my_dict.items()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from operator import itemgetter | |
newList = sorted(listToSort, key=itemgetter('key')) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import csv | |
with open('sample_data.csv') as f: | |
for row in csv.reader(f): | |
print row |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
for n in range(2, 100): | |
for i in range(2, n): | |
if n % i == 0: | |
break | |
else: | |
print '{} is a prime!'.format(n) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# prefer | |
def _addErr1(errors, field, message): | |
errors.setdefault(field, []).append(message) | |
# not prefer | |
def _addErr2(errors, field, message): | |
if not field in errors: | |
errors[field] = [] | |
errors[field].append(message) |
OlderNewer