Skip to content

Instantly share code, notes, and snippets.

View kraft001's full-sized avatar

Konstantin Rafalskii kraft001

View GitHub Profile
@kraft001
kraft001 / solarized.bash
Created June 8, 2012 05:47
solarized Gnome Terminal + Tmux + Vim
# 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 January 12, 2012 06:14
Parse date hash to the Date object
Date.civil(
*params[:date].
values_at(*%w(year month day)).
map(&:to_i)
) rescue Time.now
@kraft001
kraft001 / firebug_post_queries.js
Created November 21, 2011 10:52
Test RESTful API through Firebug console (post queries)
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);
}
};