Skip to content

Instantly share code, notes, and snippets.

@spicycode
spicycode / tmux.conf
Created September 20, 2011 16:43
The best and greatest tmux.conf ever
# 0 is too far from ` ;)
set -g base-index 1
# Automatically set window title
set-window-option -g automatic-rename on
set-option -g set-titles on
#set -g default-terminal screen-256color
set -g status-keys vi
set -g history-limit 10000
@fab13n
fab13n / gist:1301283
Created October 20, 2011 14:29
metalua/treequery/walk.mlua
-{ extension "match" }
local M = { traverse = { }; tags = { }; debug = false }
--------------------------------------------------------------------------------
-- Standard tags: can be used to guess the type of an AST, or to check
-- that the type of an AST is respected.
--------------------------------------------------------------------------------
M.tags.stat = table.transpose{
@vladocar
vladocar / GuidesUnitGrid.js
Created November 3, 2011 03:50
Make Guides Grid with units in Photoshop CS5
var doc = app.activeDocument;
var guides = app.activeDocument.guides;
var w = doc.width;
var h = doc.height;
function MakeGuidesGrid(unitVertical, gutterVertical, unitHorisontal, gutterHorisontal) {
if (unitHorisontal !== 0) {
var j = h / unitHorisontal;
for (var i = 0; i < j; i++) {
guides.add(Direction.HORIZONTAL, i * unitHorisontal);
@tj
tj / stylus.md
Created January 13, 2012 19:14

Stylus

A dynamic, expressive, powerful language compiling to CSS.

SLIDE:

whoami

tj holowaychuk

@johnnyg
johnnyg / transplant.py
Created January 19, 2012 12:53
Deluge transplant script - allows you to selectively import & export torrents
from deluge._libtorrent import lt
from deluge.core.torrentmanager import TorrentManagerState
from shutil import copy, _samefile
import cPickle
import os
class Transplant(object):
def __init__(self, config_dir="", torrent_ids=None, torrents=None):
self.state_dir = ""
self.torrents = {}
@rithvikgv
rithvikgv / gist:1916925
Created February 26, 2012 13:53
AppleScript to snap windows to the right à la Windows 7 Aero Snap
-- get Dock height
tell application "System Events" to tell process "Dock"
set dock_dimensions to size in list 1
set dock_height to item 2 of dock_dimensions
end tell
-- get the new width and height for the window
tell application "Finder"
set desktop_dimensions to bounds of window of desktop
set new_width to (item 3 of desktop_dimensions) / 2
set new_height to (item 4 of desktop_dimensions) - dock_height
@dpflug
dpflug / gist:1986830
Created March 6, 2012 15:36
Substrate by j.tarbell
// Substrate Watercolor
// j.tarbell June, 2004
// Albuquerque, New Mexico
// complexification.net
// Processing 0085 Beta syntax update
// j.tarbell April, 2005
int dimx = 250;
int dimy = 250;
@michih57
michih57 / pygmentize
Created April 6, 2012 13:59
Ugly wrapper around pygmentize to speed up pdflatex using the minted package for syntax highlighting
#!/bin/bash
# An ugly hack to speed up pdflatex using the minted package
# place this file with the name 'pygmentize' somewhere on your
# path before the 'real' pygmentize, such that this file gets
# executed and can act as a wrapper around the 'real' pygmentize.
# This script computes a hash-value (md5sum) of the input file
# from minted and caches the output of pygmentize.
# The working directory is used to store the cached files (it's an ugly hack...)
# The real pygmentize command, may need customization to work on your system.
function find_roku {
for i in $(arp -a | awk '{print $2}' | sed "s/[(|)]//g"); do
curl $i:8060 &>/dev/null
if [[ "$?" == "0" ]]; then
echo $i
export ROKU_IP=$i
fi
done
}
@mgedmin
mgedmin / show-all-256-colors.py
Last active August 24, 2023 16:23
Script to show all 256 colors supported by xterms
#!/usr/bin/python
"""Print a swatch using all 256 colors of 256-color-capable terminals."""
__author__ = "Marius Gedminas <marius@gedmin.as>"
__url__ = "https://gist.github.com/mgedmin/2762225"
__version__ = '2.0'
def hrun(start, width, padding=0):