Skip to content

Instantly share code, notes, and snippets.

@hawx
hawx / widen-github.js
Last active December 22, 2015 05:39
Widen Github .bookmarklet
javascript: (
function() {
var widenGithubs = '.container { width: 1280px; } ' +
'.container .repository-content { width: 1230px; } ' +
'.container .repository-with-sidebar.with-full-navigation .repository-content { width: 1080px; } ' +
'.container .column { width: 1092px; } ' +
'#files .diffstat+.css-truncate-target { max-width: 855px !important;} ' +
'.discussion-timeline { width: 1055px; } ' +
'.comment-holder { width: 952px !important; } ' +
'.inline-comments .comment-holder { width: 1100px !important; max-width: 1100px !important; } ' +
@hawx
hawx / README.md
Created May 8, 2013 11:16
My screensaver, shows random faved tweets on a loop.

Favtwit

My (mac) screensaver. Download and install the IdleWeb screensaver. Put the files above into a folder somewhere along with twitterlib.min.js. Then setup.

@hawx
hawx / hooks.rb
Created April 30, 2013 18:38
Additions to minitest
module MiniTestWithHooks
class Unit < MiniTest::Unit
attr_reader :before_suites, :after_suites
def before_suites(&block)
(@before_suites ||= []) << block
end
def after_suites(&block)
@hawx
hawx / test.go
Created March 12, 2013 10:18
Test of hadfield.
package main
import (
"github.com/hawx/hadfield"
"fmt"
"os"
)
var cmdGreet = &hadfield.Command{
Usage: "greet [options]",
@hawx
hawx / img-lomo
Created February 27, 2013 11:53
Extends img with a lomo command. Requires imagemagick to generate a mask then adjusts and composes the final image with img.
#!/usr/bin/env sh
function usage {
echo "lomo [options]"
}
function short {
echo "applies a simple lomo effect to the image."
}
@hawx
hawx / img-lomo.go
Created January 18, 2013 17:19
Extends img with a lomo command. An attempt to replicate the shell script given in the README in pure Go.
package main
import (
"code.google.com/p/graphics-go/graphics"
"github.com/nfnt/resize"
"github.com/hawx/img/blend"
"github.com/hawx/img/contrast"
"github.com/hawx/img/hsla"
"github.com/hawx/img/utils"
@hawx
hawx / gist:4540015
Last active December 11, 2015 03:48
Shows an example of an external "img" script. Note the flags; --usage, --short and --long which are required. img will forward any calls to 'img testing' with the given arguments. It will also display formatted help for `img help testing`, `img testing -h` and `img testing --help`, and list the `testing` command in a section of `img help`.
#!/usr/bin/env sh
# Needs to be on $PATH as "img-testing".
function usage {
echo "testing [args]"
}
function short {
echo "A script to test external img scripts."
}
@hawx
hawx / splitconv.sh
Created January 5, 2013 17:59
Takes a pdf, splits pages in half horizontally, rotates them, then glues them together into a pdf.
# Usage: sh splitconv.sh "some.pdf"
echo "Making temporary directory..."
mkdir "splitconv-tmp"
echo "Splitting pdf..."
convert -size 1x2@ "$1" "splitconv-tmp/split.png"
echo "Rotating pages..."
convert -rotate 270 "tmp-tmp-tmp/split-*.png" "splitconv-tmp/rot.png"
@hawx
hawx / Monokai.css
Created October 17, 2012 08:55
Modified Monokai theme for Espresso
/*
@theme Monokai
@override-placeholders html, xml, css, sourcecode.js, sourcecode.php, sass, markdown
@author Derek Reynolds
@version 1.0b1
@original https://github.com/derekr/monokai.foam
This is a port of the Monokai theme for TextMate.
The original theme can be found at: http://www.monokai.nl/blog/2006/07/15/textmate-color-theme/
TextMate can be found at: http://macromates.com/
@hawx
hawx / prettymaker.sh
Created September 20, 2012 14:40
Make large prettymap maps.
#!/usr/bin/env sh
#
# Usage: prettymaker <start-row> <end-row> <start-col> <end-col>
#
# Prettymaker will pull map tiles from in the ranges specified at level 10
# zoom from prettymaps.stamen.com and build a massive map. Each tile is
# 256x256px so fully created map may be large!
#
# Note: run this in an empty folder, it deletes stuff during processing and
# may catch items you didn't want deleted.