def build():
nodes = {}
node['a'] = Node(...)
node['b'] = Node(...)
...
This file contains hidden or 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
| cd /Applications && curl http://www.ninjamonkeysoftware.com/slate/versions/slate-latest.tar.gz | tar -xz |
This file contains hidden or 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
| import random | |
| def compare_with_ties(a, b): | |
| diff = cmp(a, b) | |
| return diff if diff else random.choice([-1, 1]) | |
| a = {'a': 1, 'b': 2, 'c': 1, 'd':2, 'e': 1} | |
| print "Initial dictionary:\n", str(a.iteritems()) |
This file contains hidden or 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
| import random | |
| def compare_with_ties(a, b): | |
| diff = cmp(a, b) | |
| return diff if diff else random.choice([-1, 1]) | |
| a = {'a': 1, 'b': 2, 'c': 1, 'd':2, 'e': 1} | |
| print "Initial dictionary:\n", str(a.iteritems()) |
This file contains hidden or 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
| // source: http://stackoverflow.com/questions/15182496/why-does-this-code-print-hello-world?newsletter=1&nlcode=83359%7c512e | |
| System.out.println(randomString(-229985452) + " " + randomString(-147909649)); | |
| public static String randomString(int i) | |
| { | |
| Random ran = new Random(i); | |
| StringBuilder sb = new StringBuilder(); | |
| for (int n = 0; ; n++) |
This file contains hidden or 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
| int main(){ | |
| <:]{%>; // smile! | |
| } |
This file contains hidden or 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
| def __init__(self, *args, **kw): | |
| super(EditProfileForm, self).__init__(*args, **kw) | |
| index = self.fields.keyOrder.index('about') | |
| self.fields.keyOrder.remove('majors') | |
| self.fields.keyOrder.insert(index, 'majors') |
This file contains hidden or 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
| #!/bin/bash | |
| DIRS=( /tmp/scifi /tmp/fiction /tmp/math ) | |
| DEST=/foo/bar/library | |
| for u in ${DIRS[@]} | |
| do | |
| echo "linking $u into $DEST" | |
| ln $u $DEST | |
| done |
This file contains hidden or 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
| #!/bin/sh | |
| # Some things taken from here | |
| # https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
| # Set the colours you can use | |
| black='\033[0;30m' | |
| white='\033[0;37m' | |
| red='\033[0;31m' | |
| green='\033[0;32m' |
This file contains hidden or 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
| memory | max_idle_in_min | |
|---|---|---|
| 128 | 27 | |
| 256 | 27 | |
| 512 | 27 | |
| 1024 | 27 | |
| 1152 | 27 | |
| 1280 | 27 | |
| 1408 | 27 | |
| 1536 | 27 | |
| 1792 | 27 |