Backstory: I decided to crowdsource static site generator recommendations, so the following are actual real world suggested-to-me results. I then took those and sorted them by language/server and, just for a decent relative metric, their Github Watcher count. If you want a heap of other projects (including other languages like Haskell and Python) Nanoc has the mother of all site generator lists. If you recommend another one, by all means add a comment.
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
sudo apt-get install python2.7 | |
sudo update-alternatives --install /usr/bin/python python /usr/bin/python2.6 20 | |
sudo update-alternatives --install /usr/bin/python python /usr/bin/python2.7 10 | |
sudo update-alternatives --set python /usr/bin/python2.6 | |
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
def funct(list1, list2): | |
assert isinstance(list1, list) and isinstance(list2, list) |
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
if verbose: | |
def verboseprint(*args): | |
# Print each argument separately so caller doesn't need to | |
# stuff everything to be printed into a single string | |
for arg in args: | |
print arg, | |
else: | |
verboseprint = lambda *a: None # do-nothing function |
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
if sys.version_info < (2, 6): | |
print('ERROR: %s' % sys.exc_info()[1]) | |
print('ERROR: this script requires Python 2.6 or greater.') | |
sys.exit(101) |
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 logging.config | |
logging.config.fileConfig('logging.conf') | |
log = logging.getLogger(__name__) |
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
###################################################################### | |
# CURRENT AWARE LOCAL DATETIME | |
###################################################################### | |
from datetime import datetime | |
from tzlocal import get_localzone | |
local_tz = get_localzone() | |
local_dt = datetime.now(local_tz) |
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/python3 | |
def mapReduceTR(f, combine, zero, a, b): | |
def loop(a, acc): | |
if (a > b): | |
return acc | |
else: | |
return loop(a + 1, combine(f(a), acc)) | |
return loop(a, zero) |
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
#!/bin/bash | |
say() | |
{ | |
mplayer -really-quiet -ao alsa "http://translate.google.com/translate_tts?tl=it&q=$*" | |
} | |
say $* |
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 httplib2 as http | |
import json | |
try: | |
from urlparse import urlparse | |
except ImportError: | |
from urllib.parse import urlparse | |
headers = { | |
'Accept': 'application/json', |
OlderNewer