Skip to content

Instantly share code, notes, and snippets.

@dobrych
dobrych / .inputrc
Created January 6, 2010 12:19
basic .inputrc dotfile
# this makes the "delete" key work rather than
# just entering a ~
"\e[3~": delete-char
# these allow you to use ctrl+left/right arrow keys
# to jump the cursor over words
"\e[5C": forward-word
"\e[5D": backward-word
# these allow you to start typing a command and
@dobrych
dobrych / gist:964137
Created May 10, 2011 09:04
apache zenlist seo
# global apache config context
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_http_module modules/mod_proxy_http.so
# ----------
# virtual host context
RewriteEngine On
RewriteCond %{QUERY_STRING} .*_escaped_fragment_.*
RewriteRule / http://seo.zenlist.com/?host=%{HTTP_HOST}&uri=/?%{QUERY_STRING} [P]
@dobrych
dobrych / gist:964998
Created May 10, 2011 17:59
parse virtual hosts info from multiple apache configs
#!/bin/sh
find /webhomes/*/conf -name vhost.conf | while read -r CONF
do
username=$(echo $CONF | awk 'BEGIN { FS = "/" } ; {print $3}')
domains=$(egrep 'ServerName|ServerAlias' $CONF | awk '{print $2}')
echo $username: $domains
echo
done
@dobrych
dobrych / gist:1082332
Created July 14, 2011 12:06
zenlist include
<html>
<head>
<script src="http://dev-upload.zenlist.com:9191/js/client.js" type="text/javascript"></script>
</head>
<body>
<div id="zenlist" name="zenlist" class="mainWrapper"></div><!-- zenlist -->
<div class="mainWrapper featured_block"></div><!-- zenlist -->
<script>
Zenlist.urls.assets = 'http://dev-upload.zenlist.com:9191';
Zenlist.urls.api = 'http://dev-api.zenlist.com:8151/';
@dobrych
dobrych / rails.conf
Created December 10, 2011 00:25 — forked from jcf/rails.conf
NewSyslog Log Rotate on OS X
# Rotate rails logs on OS X using newsyslog
# count: how many old files to keep around, this is dev, so 0
# size: 1000 kb
# when: * - only rely on the size property
# flags: G - interpret logfilename as a shell pattern
# logfilename [owner:group] mode count size when flags [/pid_file] [sig_num]
/Users/jcf/Code/**/log/*.log 666 0 1000 * G
@dobrych
dobrych / rails.conf
Created December 10, 2011 00:39 — forked from jcf/rails.conf
NewSyslog Log Rotate on OS X
# Rotate rails logs on OS X using newsyslog
# count: how many old files to keep around, this is dev, so 0
# size: 1000 kb
# when: * - only rely on the size property
# flags: G - interpret logfilename as a shell pattern
# logfilename [owner:group] mode count size when flags [/pid_file] [sig_num]
/Users/jcf/Code/**/log/*.log 666 0 1000 * G
@dobrych
dobrych / git versioner
Created January 23, 2012 17:07 — forked from Abizern/git versioner
Xcode build script that adds the commit sha to the CFBundleVersion
#!/usr/bin/env ruby
# Xcode auto-versioning script for Subversion by Axel Andersson
# Updated for git by Marcus S. Zarra and Matt Long
# Converted to ruby by Abizer Nasir
# Appends the git sha to the version number set in Xcode.
# see http://www.stompy.org/2008/08/14/xcode-and-git-another-build-script/ for more details
# These are the common places where git is installed.
# Change this if your path isn't here
@dobrych
dobrych / read_png_row_to_json.py
Last active December 19, 2015 21:28
made a quick script that generates json list of rgb values from png row, useful for palette reading # pip install pypng
import png
f = open('palette.png', 'r')
p = png.Reader(f)
res = p.read()
palette = res[3]['palette']
data = list(res[2])
@dobrych
dobrych / GIF-Screencast-OSX.md
Created November 23, 2015 19:32 — forked from dergachev/GIF-Screencast-OSX.md
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

def fetch_batch(page=0):
while True:
res = API.datasets(DATASET_ID).area().get(
apikey=APIKEY,
polygon=POLYGON,
count=PAGESIZE,
var=VARIABLE,
offset=PAGESIZE * page,
grouping='location',
)