Skip to content

Instantly share code, notes, and snippets.

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

Description

This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

#!/bin/bash
convert $1 -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 $2

Results

// OOP
console.log( 'OHAI'.blink() );
// Call invocation
console.log( String.prototype.blink.call('OHAI') );
// $ always makes things look awesome.
var $ = Function.prototype.call;
// Very explicit call invocation
@coldhawaiian
coldhawaiian / styles.less
Last active August 29, 2015 13:57
Personal style sheet for Atom editor
/*
* Your Stylesheet
*
* This stylesheet is loaded when Atom starts up and is reloaded automatically
* when it is changed.
*
* If you are unfamiliar with LESS, you can read more about it here:
* http://www.lesscss.org
*/
@coldhawaiian
coldhawaiian / practice.rb
Last active May 25, 2016 16:15
Just playing around with some Ruby.
# Eager (non-lazy) sequence generation:
(0..8).each_cons(2).map { |a,b| a + b }
# Another form (of above)
(1..10).each_with_object([1]) { |i,a| a[i] = a[i-1] + 2 }
# Eager Fibonacci (generates n+1 Fibonacci numbers)
(2..10).each_with_object([0,1]) { |i,a| a[i] = a[i-2] + a[i-1] }
# Corrected for n = 1 or 2, and removed extra number

Sublime Text 2 - Useful Shortcuts

Tested in Mac OS X: super == command

Open/Goto


  • super+t: go to file
  • super+ctrl+p: go to project
  • super+r: go to methods
root_DN = /CN=Esotericsystems Root Authority/C=AT/
issuing_DN = /CN=Esotericsystems Issuing Authority/C=AT/
passphrase:
echo -n changeme > $@
#
# Create param files, keys and Self-Signed Certificate for the Root CA
#
root-ca-dsa.param: passphrase
# SSL self signed localhost for rails start to finish, no red warnings.
# 1) Create your private key (any password will do, we remove it below)
$ openssl genrsa -des3 -out server.orig.key 2048
# 2) Remove the password
$ openssl rsa -in server.orig.key -out server.key
require 'open-uri'
require 'json'
language = 'en'
print 'What do you need to know? : '
article = URI::encode gets.chomp
request_url = "http://#{language}.wikipedia.org/w/api.php?action=parse&page=#{article}&format=json&prop=text&section=0"