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
| function fitProjection(projection, data, box, center) { | |
| // get the bounding box for the data - might be more efficient approaches | |
| var left = Infinity, | |
| bottom = -Infinity, | |
| right = -Infinity, | |
| top = Infinity; | |
| // reset projection | |
| projection | |
| .scale(1) | |
| .translate([0, 0]); |
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/python | |
| import subprocess | |
| import re | |
| from optparse import OptionParser | |
| def git_version(): | |
| p = subprocess.Popen(["git", "log" , '-1', '--date=iso'], stdout=subprocess.PIPE) | |
| out, err = p.communicate() | |
| m = re.search('\d{4}-\d{2}-\d{2}\s+\d{2}:\d{2}:\d{2}', out) |
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
| *.pyc | |
| /bin | |
| /include | |
| /lib |
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 | |
| export PATH=/bin:/usr/bin:/sbin:/usr/sbin | |
| usage=$( | |
| cat <<EOF | |
| $0 [OPTIONS] start/stop | |
| -s set speed default 256Kbit/s | |
| -p set port default 3000 | |
| -d set delay default 350ms |
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 re | |
| # Some mobile browsers which look like desktop browsers. | |
| RE_MOBILE = re.compile(r"(iphone|ipod|blackberry|android|palm|windows\s+ce)", re.I) | |
| RE_DESKTOP = re.compile(r"(windows|linux|os\s+[x9]|solaris|bsd)", re.I) | |
| RE_BOT = re.compile(r"(spider|crawl|slurp|bot)") | |
| def is_desktop(user_agent): | |
| """ |
NewerOlder