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/ruby | |
# ************************************************************************** | |
# ### modified based on: | |
# http://stackoverflow.com/questions/123378/command-line-unix-ascii-based-charting-plotting-tool | |
# ### | |
# eplot | |
# Written by Christian Wolf | |
# | |
# eplot ("easy gnuplot") is a shell script which allows to pipe data easily | |
# through gnuplot and create plots quickly, which can be saved in postscript, |
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 bash | |
################################################################################ | |
# Use as a global mercurial/git pre commit or pre push hook to detect the type | |
# of project and run unittests before allowing a commit or push to a remote | |
# repository. | |
# | |
# Handy so that you don't have to remember to add test running hooks to every | |
# repo clone/fork you have. | |
# | |
# ********** MERCURIAL SETUP ************* |
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
# loop foreva-eva | |
def loop(sequence): | |
while True: | |
for elem in sequence: | |
yield elem | |
# example usage, imagine you have a set of things you want | |
# to cycle through, removing bad ones as they appear | |
class ObjectPoolEmptyError(Exception): |
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 date_xrange(s_dt, e_dt, inclusive=False): | |
ONE_DAY = timedelta(days=1) | |
days = (e_dt - s_dt).days | |
days = days + 1 if inclusive else days | |
return (s_dt + i*ONE_DAY for i in range(0, days)) |
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 | |
# This script finds all the mercurial repositories in the current directory | |
# and does a "hg $@" to batch execute a mercurial command in all the repositories. | |
# | |
# Make sure you know what you're doing before running this ;-) | |
# | |
# Examples: | |
# | |
# Perform pull -u on all repositories to get the latest changes and update: |
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
"colo dawn | |
"colo ir_black | |
"colo maroloccio | |
colo darkbone | |
"set guifont=Monaco:h14 | |
set guifont=DejaVu\ Sans\ Mono\ Bold:h14 | |
"set guifont=Inconsolata\ Bold:h16 | |
set hls is ic scs | |
set gcr=n:blinkon0 |
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 | |
# Notes | |
# One can easily get the current epoch using the date command, like so: | |
# | |
# in your timezone: | |
# | |
# $ date -j +"%s" | |
# 1363104249 | |
# |
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 bash | |
###### | |
# Why is this useful? | |
# | |
# Say you have a list of ids in a database tool like SequelPro in | |
# the result of a query. It is possible to copy an entire column | |
# to the clipboard. But then you may want to pass that list of | |
# ids as a comma-separated list into an HTTP(S) API endpoint for | |
# testing. This solves that problem! |
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
# -*- coding: utf-8 -*- | |
from instagram.client import InstagramAPI | |
import time | |
access_token = "REDACTED" | |
api = InstagramAPI(access_token=access_token, client_id='REDACTED', client_secret='REDACTED') | |
media_id = 'REDACTED' | |
response = api.media(media_id=media_id) |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |