Skip to content

Instantly share code, notes, and snippets.

@kraft001
kraft001 / solarized.bash
Created Jun 8, 2012
solarized Gnome Terminal + Tmux + Vim
View solarized.bash
# store all solarized files in one place
mkdir ~/.solarized
cd ~/.solarized
# http://www.webupd8.org/2011/04/solarized-must-have-color-paletter-for.html
git clone https://github.com/seebi/dircolors-solarized.git
eval `dircolors ~/.solarized/dircolors-solarized/dircolors.256dark`
ln -s ~/.solarized/dircolors-solarized/dircolors.256dark ~/.dir_colors
git clone https://github.com/sigurdga/gnome-terminal-colors-solarized.git
@kraft001
kraft001 / date_parse
Created Jan 12, 2012
Parse date hash to the Date object
View date_parse
Date.civil(
*params[:date].
values_at(*%w(year month day)).
map(&:to_i)
) rescue Time.now
@kraft001
kraft001 / firebug_post_queries.js
Created Nov 21, 2011
Test RESTful API through Firebug console (post queries)
View firebug_post_queries.js
var http = new XMLHttpRequest();
http.open("POST", "http://gsb.rf/api2/sessions");
var params = "args=type:card,login:123,password:345";
http.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
http.setRequestHeader("Content-length", params.length);
http.onreadystatechange = function() {
if (http.readyState == 4 && http.status == 200) {
console.info(http.responseText);
}
};