Skip to content

Instantly share code, notes, and snippets.

View cyakimov's full-sized avatar
🏠
Working from home

Carlos Yakimov cyakimov

🏠
Working from home
  • Falabella
  • Santiago, Chile
View GitHub Profile
@cyakimov
cyakimov / description.txt
Created July 11, 2011 20:38 — forked from samueldana/description.txt
Server setup issue using Nginx, RVM, Ruby-1.9.1, and Thin
So, I'm setting up a new Ubuntu 10.04 server with nginx, RVM, Ruby-1.9.1, and Thin.
I got through installing nginx, RVM, ruby-1.9.1 without any problems.
Ruby-1.9.1 was installed using 'rvm install x';
I don't have a system Ruby (Which is what I've been doing previously).
I've also set the default ruby to 1.9.1 for myself and root.
I installed the thin gem using 'gem install thin'
I then installed thin to the system using
'thin install'
@cyakimov
cyakimov / gist:1049915
Created June 27, 2011 21:41
CentOS / Fedora 'build-essential' equivalent
yum groupinstall "Development Tools"
@cyakimov
cyakimov / visibility.js
Created June 20, 2011 16:01 — forked from niallkennedy/visibility.js
Page Visibility API visibility test using jQuery
var isVisible = false;
function onVisible() {
isVisible = true;
jQuery.getScript("http://www.google-analytics.com/ga.js");
}
if ( document.webkitVisibilityState === undefined || document.webkitVisibilityState === "visible" ) {
onVisible();
} else {
jQuery.bind( "webkitvisibilitychange", function() {
@cyakimov
cyakimov / gist:1019169
Created June 10, 2011 16:09
Filter empty strings and nils from array in Ruby
#["",nil,"something","another",123,""] => ["something","another",123]
array_to_filter.reject &:empty?
@cyakimov
cyakimov / gist:1007096
Created June 3, 2011 20:24
Array to Hash in Ruby
#Create a hash like {1=>2, 3=>4} from Array of values
arr = [1,2,3,4]
hash = Hash[*arr]