Skip to content

Instantly share code, notes, and snippets.

alias gitgraph="git log --graph --full-history --all --color --pretty=format:\"%x1b[31m%h%x09%x1b[32m%d%x1b[0m%x20%s\""
@burnto
burnto / gist:943432
Created April 26, 2011 23:50
.bash_profile colors
export TERM=xterm-color
# set colors and prompt
#PS1="\[\e]2;\w\a\][\[\e[32m\]\u\[\e[0m\]@\[\e[31m\]\h\[\e[0m]\]:\[\e[35m\]\w\[\e[0m\]$ "
#PS2=">> "
#export PS1 PS2
export CLICOLOR="true"
export LSCOLORS="exfxcxdxbxegedabagacad"
# set a fancy prompt (non-color, unless we know we "want" color)
case "$TERM" in
@burnto
burnto / _gradient.scss
Created February 25, 2011 07:01
Gradient scss mixin
// Vertical gradient scss mixin
@mixin gradient($start-color: #f3f3f3, $end-color: #fcfcfc) {
background: $start-color; /* for non-css3 browsers */
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#{$start-color}', endColorstr='#{$end-color}'); /* ie */
background: -webkit-gradient(linear, left top, left bottom, from($start-color), to($end-color)); /* webkit */
background: -moz-linear-gradient(top, $start-color, $end-color); /* ff */
}
// --- Usage ---
@burnto
burnto / _image_replace.scss
Created February 25, 2011 06:59
Image replacement scss mixin
// Image replacement scss mixin
@mixin image_replace($img, $width, $height, $x: 0, $y: 0) {
display: block;
background: image-url($img) no-repeat $x $y;
width: $width;
height: $height;
overflow: hidden;
text-indent: -9999em;
}
hello humans
@burnto
burnto / happy.md
Created October 20, 2010 02:04 — forked from huned/happy.md

Some stuff that makes me happy:

  • good decisions
  • well written, persuasive prose
  • elegant solutions
  • evocative experiences
  • genuine, honest communication
  • afterglow
  • summertime
  • doodling
Array.prototype.simple_moving_average = function(window_length) {
var averaged = new Array(this.length);
var chunk = [];
for (k = 0; k < this.length; k++) {
chunk.push(this[k]);
if (chunk.length > window_length) chunk.shift();
averaged[k] = chunk.sum() / chunk.length; // sum() is an exercise left to the reader
}
return averaged;
};
git log --since=yesterday
git log --since="3 days ago"
git log --before=today
@burnto
burnto / all youtube comments in a category
Created December 8, 2009 08:10
grab retarded youtube comments for category or keyword
require 'rubygems'
require 'hpricot'
require 'open-uri'
n = ARGV[0]
n = n.gsub(/\s+/, "%2C%2D")
xml = open("http://gdata.youtube.com/feeds/api/videos?category=#{n}").read
doc = Hpricot::XML(xml)