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
#! /usr/bin/env python | |
import os | |
import requests | |
import sys | |
from BeautifulSoup import BeautifulSoup | |
from commands import getoutput | |
from hashlib import sha1 | |
from os.path import expanduser, isfile, join |
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
dynamodb election: | |
- find node responsible for key K | |
- look up K 'master' | |
- value in K is of the format <seqid>|<status>|<address>|<port> | |
- if addr:port is self and status != C, then assume role, incr seqid and poll/update K every N/2 | |
- connect to addr:port | |
- if connected, it would only respond with results if it is still within timer, | |
else it would send back notification of not-responsible-any-more. | |
- if not responsible, check store again | |
- else, initiate new election |
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
"Consider an upward-stretching network of infomachines tethered together, rung-upon-rung (billowing slightly in the breeze?) No two rungs need have exactly the same number of machines.... There might be ten rungs in all or hundreds or thousands, and the average rung might have anywhere from a handful to hundreds of members. This architecture spans a huge range of shapes and sizes.... | |
So, these things are "tethered together" -- meaning? Those lines are lines of communication. Each member of the Trellis is tethered to some lower-down machines and to some higher-ups.... A machine deals only with the machines to which it is tethered. So far as it's concerned, the rest don't exist. It deals with inferiors in a certain way and superiors in a certain other way, and that's it.... | |
Information rushes upward through the network, and the machines on each rung respond to it on their own terms.... Each machine focuses on one piece of the problem -- on answering a single question about the thing out there...that is being |
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
#! /usr/bin/env python | |
import sys | |
from plumbum import FG | |
from plumbum.cmd import open | |
for line in sys.stdin.read().split('\n'): | |
line = line.strip() | |
if not line: |
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
#! /usr/bin/env python | |
"""Usage: lezz <language> [<file>] | |
Alternatively, you can pipe some text via stdin, e.g. | |
$ cat Boltfile | lezz go | |
""" | |
import sys |
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
trustmap = """ | |
alastairparvin -> indy_johar jimmygreer jonisteiner martinluff nick_diaconou tav thruflo tsalfield | |
chrmoment -> alastairparvin joe tav tsalfield | |
indy_johar -> alastairparvin jonisteiner nick_diaconou tav | |
jimmygreer -> alastairparvin nick_diaconou | |
jonisteiner -> indy_johar lyntonpepper nick_diaconou tav thruflo | |
lyntonpepper -> alastairparvin jonisteiner nick_diaconou | |
martinluff -> alastairparvin nick_diaconou | |
micrypt -> alastairparvin tav tsalfield | |
nick_diaconou -> alastairparvin jimmygreer jonisteiner lyntonpepper martinluff tav thruflo tsalfield |
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
# include the user's local bin on the PATH if it exists | |
if [ -d ~/.local/bin ] ; then | |
PATH=~/.local/bin:"${PATH}" | |
fi | |
# only search directories on cd tab completion | |
complete -d cd | |
# ignore case with tab completion | |
set completion-ignore-case On |
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
_optparse_completion() { | |
COMPREPLY=( $( \ | |
COMP_LINE=$COMP_LINE COMP_POINT=$COMP_POINT \ | |
COMP_WORDS="${COMP_WORDS[*]}" COMP_CWORD=$COMP_CWORD \ | |
OPTPARSE_AUTO_COMPLETE=1 $1 ) ) | |
} | |
if test "$PS1"; then | |
shopt -s extglob progcomp | |
complete -o default -F _optparse_completion html2domly |
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
[]string{ | |
UserTerm + "tom", "\x01hello" | |
} | |
seen := map[string][string] | |
for _, token := range tokens { | |
switch token.Type { | |
case Link: | |
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 logging | |
from cgi import escape | |
from decimal import Decimal | |
from json import loads as decode_json | |
from google.appengine.api import memcache | |
from google.appengine.api.urlfetch import fetch as urlfetch, POST | |
from google.appengine.ext import db |