Skip to content

Instantly share code, notes, and snippets.

@BinaryMuse
BinaryMuse / colortest
Created April 1, 2011 22:40
perl based color test for your terminal
#!/usr/bin/perl
# by entheon, do whatever the hell you want with this file
print "\n";
print "**************************\n";
print "*XTERM 256Color Test Chart\n";
print "**************************\n";
print "* 16 = black\n";
print "* 255 = white\n";
@natesilva
natesilva / markdown.vim
Created May 6, 2011 23:44
Vim: Preview a Markdown document in the default browser on Windows or Mac OS X
"
" While editing a Markdown document in Vim, preview it in the
" default browser.
"
" Author: Nate Silva
"
" To install: Place markdown.vim in ~/.vim/ftplugin or
" %USERPROFILE%\vimfiles\ftplugin.
"
" To use: While editing a Markdown file, press ',p' (comma p)
@mebens
mebens / camera.lua
Created May 8, 2011 20:52
Example code for part 3 of my Cameras in Love2D tutorial series.
camera = {}
camera._x = 0
camera._y = 0
camera.scaleX = 1
camera.scaleY = 1
camera.rotation = 0
function camera:set()
love.graphics.push()
love.graphics.rotate(-self.rotation)
@pksunkara
pksunkara / config
Last active May 22, 2024 13:43
Sample of git config file (Example .gitconfig) (Place them in $XDG_CONFIG_HOME/git)
[user]
name = Pavan Kumar Sunkara
email = pavan.sss1991@gmail.com
username = pksunkara
[init]
defaultBranch = master
[core]
editor = nvim
whitespace = fix,-indent-with-non-tab,trailing-space,cr-at-eol
pager = delta
@osteslag
osteslag / version.sh
Created July 18, 2011 12:45
Script for managing build and version numbers using git and agvtool. See link in comments below.
#!/bin/sh
# Script for managing build and version numbers using git and agvtool.
# Change log:
# v1.0 18-Jul-11 First public release.
# v1.1 29-Sep-12 Launch git, agvtool via xcrun.
version() {
@jacobjoaquin
jacobjoaquin / Markov_Experiment_II.rtf
Created August 21, 2011 22:15
SuperCollider Markov Experiment II
// SuperCollider Markov Experiment II
// August 21st, 2011
// Jacob Joaquin
// CodeHop.com
//
// Translated from Csound:
// http://codehop.com/markov-experiment-ii/
SynthDef(\my_synth, {|dur = 1.0, amp = 1.0, freq = 440|
var env = EnvGen.ar(Env.new([1, 0.1, 0], [0.06, dur - 0.06]), doneAction: 2);
@defunkt
defunkt / gitio
Created September 11, 2011 08:11
Turn a github.com URL into a git.io URL.
#!/usr/bin/env ruby
# Usage: gitio URL [CODE]
#
# Turns a github.com URL
# into a git.io URL
#
# Copies the git.io URL to your clipboard.
url = ARGV[0]
code = ARGV[1]
@bemasher
bemasher / Castle.xml
Created September 18, 2011 03:46
Example of parsing xml in golang.
<?xml version="1.0" encoding="UTF-8" ?>
<Data>
<Series>
<id>83462</id>
<Actors>|Nathan Fillion|Stana Katic|Molly C. Quinn|Jon Huertas|Seamus Dever|Tamala Jones|Susan Sullivan|Ruben Santiago-Hudson|Monet Mazur|</Actors>
<Airs_DayOfWeek>Monday</Airs_DayOfWeek>
<Airs_Time>10:00 PM</Airs_Time>
<ContentRating>TV-PG</ContentRating>
<FirstAired>2009-03-09</FirstAired>
<Genre>|Drama|</Genre>
@mrenouf
mrenouf / git_merge_meld.sh
Created September 28, 2011 10:09
Merge helper script for using 'git mergetool' with meld, fixes http://stackoverflow.com/questions/7501666/
#!/bin/bash
# Handles proper use of Meld from Git.
#
# Instead of launching meld with $MERGED as the base revision, this
# script makes a copy of $BASE and handles copying the result back
# to $MERGED if the result was saved.
# As an extra tweak, it also presents branch names (if known) as
# the file name prefix, instead of just "LOCAL" and "REMOTE".
@miku
miku / worldclock.sh
Created October 18, 2011 08:22
Worldclock for bash.
worldclock() {
ADDIS_ABABA=`TZ=Africa/Addis_Ababa date +"%c (%z %Z)"`
BERLIN=`TZ=Europe/Berlin date +"%c (%z %Z)"`
CHICAGO=`TZ=America/Chicago date +"%c (%z %Z)"`
HONK_KONG=`TZ=Asia/Hong_Kong date +"%c (%z %Z)"`
LONDON=`TZ=Europe/London date +"%c (%z %Z)"`
LOS_ANGELES=`TZ=America/Los_Angeles date +"%c (%z %Z)"`
MOSCOW=`TZ=Europe/Moscow date +"%c (%z %Z)"`
NEW_YORK=`TZ=America/New_York date +"%c (%z %Z)"`
SOFIA=`TZ=Europe/Sofia date +"%c (%z %Z)"`