Skip to content

Instantly share code, notes, and snippets.

@javan
javan / sl2-setup.md
Created July 23, 2012 14:47
My Sublime Text 2 setup
@javan
javan / carbonator.md
Created June 29, 2012 13:35
DIY home water carbonator
@javan
javan / screenshot.js
Created June 19, 2012 21:40
Create a screenshot of any URL using phantomjs (headless webkit)
//
// Example usage: phantomjs screenshot.js http://yahoo.com /tmp/yahoo.png
//
var system = require('system');
var url = system.args[1];
var filename = system.args[2];
var page = new WebPage();
page.open(url, function (status) {
@javan
javan / gist:2433030
Created April 21, 2012 01:03
$ brew install -v imagemagick
==> Downloading http://downloads.sf.net/project/machomebrew/mirror/ImageMagick-6.7.5-7.tar.bz2
Already downloaded: /Users/javan/Library/Caches/Homebrew/imagemagick-6.7.5-7.tar.bz2
/usr/bin/tar xf /Users/javan/Library/Caches/Homebrew/imagemagick-6.7.5-7.tar.bz2
==> ./configure --disable-osx-universal-binary --without-perl --prefix=/usr/local/Cellar/imagemagick/6.7.5-7 --disable-dependency-tracking --enable-shared --disable-static --with-modules --without-gslib --with-gs-font-dir=/usr/local/share/ghostscript/fonts --without-magick-plus-plus
./configure --disable-osx-universal-binary --without-perl --prefix=/usr/local/Cellar/imagemagick/6.7.5-7 --disable-dependency-tracking --enable-shared --disable-static --with-modules --without-gslib --with-gs-font-dir=/usr/local/share/ghostscript/fonts --without-magick-plus-plus
configuring ImageMagick 6.7.5-7
checking build system type... x86_64-apple-darwin12.0.0
checking host system type... x86_64-apple-darwin12.0.0
checking target system type... x86_64-apple-darwin12.0.0
@javan
javan / emoji.m
Created January 10, 2012 02:42
Campfire Emoji
sDictionary = [[NSDictionary alloc] initWithObjectsAndKeys:
// People
@":smile:", @"\ue415",
@":blush:", @"\ue056",
@":smiley:", @"\ue057",
@":relaxed:", @"\ue414",
@":smirk:", @"\ue402",
@":heart_eyes:", @"\ue106",
@":kissing_heart:", @"\ue418",
@javan
javan / gist:1184968
Created August 31, 2011 22:52
TextMate Crash
Process: TextMate [47209]
Path: /Applications/TextMate.app/Contents/MacOS/TextMate
Identifier: com.macromates.textmate
Version: 1.5.10 (1631)
Code Type: X86 (Native)
Parent Process: launchd [198]
Date/Time: 2011-08-31 18:51:08.513 -0400
OS Version: Mac OS X 10.7.1 (11B26)
Report Version: 9
@javan
javan / pickers.html
Created August 30, 2011 22:07
jQuery UI datepicker bug
<!DOCTYPE html>
<html lang="en">
<head>
<title>picker</title>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.js"></script>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.js"></script>
<style type="text/css" media="screen">
.ui-state-active {
border: 1px solid red;
}
@javan
javan / jquery.call_once.js.coffee
Created August 29, 2011 17:32
jQuery call once plugin
$.fn.callOnce = (name, args...) ->
$(this).each ->
$el = $(this)
unless $el.data "callOnce:#{name}"
$el.data "callOnce:#{name}", true
$el[name].apply $el, args
@javan
javan / gist:1168475
Created August 24, 2011 16:32
Fix iPhone home button
Found this tip in comment here: http://www.tipb.com/2011/01/04/tipb-bug-home-button-working-iphone/
1.) Open any application
2.) Press and hold the power button until the slide to shutdown swipe bar appears.
3.) Release Power button
4.) Press and hold Home button Lightly
until screen returns to icon screen
(function($) {
Ink.TradingInterface = function(options) {
if (!(this instanceof arguments.callee)) {
return new arguments.callee(arguments);
}
var self = this;
self.initialize = function() {
self.colors = {