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 python2 | |
# coding: utf8 | |
# GistID: 8446782 | |
import hashlib | |
import os | |
import sys | |
def get_size(path): |
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
# GistID: 8301919 | |
import numpy as np | |
import gc | |
from memory_profiler import profile | |
n = 30 | |
m = 1000000 | |
@profile |
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 | |
#GistID: 8245054 | |
# By default we take a full screen shot and name it the current time | |
# If -s is passed as first argument, we do window/selection mode | |
DATETIME=$(date +%F_%T.%N | rev | cut -c 8- | rev) | |
OUTPUTDIR="~/Pictures/Screenshots/" |
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 python3 | |
# coding: utf8 | |
# GistID: 8232376 | |
import optparse | |
import sys | |
from subprocess import check_call | |
from urllib.parse import urlparse, quote, urlencode | |
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 | |
# coding: utf8 | |
import sys | |
from numpy import loadtxt | |
from matplotlib.pyplot import matshow, show | |
mat = loadtxt(sys.stdin, dtype=bool, delimiter=',') | |
matshow(mat) | |
show() |
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
// GistID: 7920541 | |
// | |
// | |
// In this exercise you should get familiar with closures and | |
// implement an elementary cellular automaton (CA) | |
// [http://en.wikipedia.org/wiki/Elementary_cellular_automaton]. Read | |
// the article before proceeding. Then study closures from | |
// https://developer.mozilla.org/en/JavaScript/Guide/Closures and make | |
// sure you understand "Emulating private methods with closures" part |
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 | |
# coding: utf8 | |
# GistID: 7893054 | |
""" A generic preprocessor. | |
Replace `#include "<file>"` lines with file contents. | |
If the line starts with '//' then leave the include line in the output | |
for reference. |
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 python3 | |
# coding: utf-8 | |
# GistID: 7799767 | |
from __future__ import print_function | |
# import cStringIO | |
import itertools | |
import os | |
import re |
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
module Main where | |
import Prelude hiding (catch) | |
import Control.Applicative | |
import Control.Exception | |
import Control.Monad.State | |
import Data.List | |
import System.IO | |
import System.Random | |
import Options.Applicative |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.