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
import urllib | |
from xml.dom import minidom | |
class TubeStatusProvider(): | |
LINESTATUS_URL = 'http://cloud.tfl.gov.uk/TrackerNet/LineStatus' | |
def get_status(self): | |
statuses = [] |
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
<div class="section"> | |
<div class="header"> | |
<h2>{{ title }}</h2> | |
</div> | |
<table class="content"> | |
<thead> | |
<tr> | |
<th>Line</th> | |
<th>Status</th> | |
</tr> |
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
diff --git a/molly/apps/places/static/places/css/smart.css b/molly/apps/places/static/places/css/smart.css | |
new file mode 100644 | |
index 0000000..95a0846 | |
--- /dev/null | |
+++ b/molly/apps/places/static/places/css/smart.css | |
@@ -0,0 +1,27 @@ | |
+/* RTI */ | |
+table.real-time-information { | |
+ width: 100%; | |
+ background: #121C28; |
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
>>> class IdentifierList(list): | |
... def by_namespace(self): | |
... return None | |
... | |
>>> class Locality(): | |
... @property | |
... def identifiers(self): | |
... return IdentifierList(self._identifiers) | |
... @identifiers.setter | |
... def identifiers(self, value): |
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
<?php | |
class Base { | |
public static $value; | |
public static function get() { | |
return static::$value; | |
} | |
} |
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 | |
""" | |
Sample Python connect script. Requires stomp.py: pip install stomp.py | |
""" | |
import logging | |
from time import sleep | |
import stomp |
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
nums = set(range(60, 70)) | |
for i in range(1, 36): | |
for j in range(i, 36): | |
if sum(range(i, j)) in nums: | |
nums.remove(sum(range(i, j))) | |
if sum(range(j, 36)) in nums: | |
nums.remove(sum(range(j, 36))) | |
print nums |
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
most_recent=`s3cmd ls $S3_BUCKET | cut -d/ -f4 | sort | tail -1` | |
base=`mktemp -d` | |
function restore_from_zip() { | |
type=$1 | |
dest=$2 | |
unzip $type.zip -d $type | |
rm -rf $dest | |
mv $type/ $dest/ | |
chown -R go:go $dest/ |
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 collections import defaultdict | |
import re | |
INPUT = """turn on 887,9 through 959,629 | |
turn on 454,398 through 844,448 | |
turn off 539,243 through 559,965 | |
turn off 370,819 through 676,868 | |
turn off 145,40 through 370,997 | |
turn off 301,3 through 808,453 | |
turn on 351,678 through 951,908 |
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
INPUT = """lf AND lq -> ls | |
iu RSHIFT 1 -> jn | |
bo OR bu -> bv | |
gj RSHIFT 1 -> hc | |
et RSHIFT 2 -> eu | |
bv AND bx -> by | |
is OR it -> iu | |
b OR n -> o | |
gf OR ge -> gg | |
NOT kt -> ku |
OlderNewer