Skip to content

Instantly share code, notes, and snippets.

View heygambo's full-sized avatar

Christian Gambardella heygambo

View GitHub Profile
@heygambo
heygambo / GamboAndOemerUrlHelper.js
Created March 23, 2011 14:40
GamboAndOemerUrlHelper
var GamboAndOemerUrlHelper = {
// public method for url encoding
encode : function (string) {
return escape(this._utf8_encode(string));
},
// public method for url decoding
decode : function (string) {
return this._utf8_decode(unescape(string));
# One of my favorite Rails Snippets
<%- if "full".empty? #comments out -%>
secret
<%- end -%>
@heygambo
heygambo / unicorn_init.sh
Created June 17, 2011 08:58
unicorn_init script for ubuntu
#!/bin/sh
#
# init.d script for single or multiple unicorn installations. Expects at least one .conf
# file in /etc/unicorn
#
# Modified by jay@gooby.org http://github.com/jaygooby
# based on http://gist.github.com/308216 by http://github.com/mguterl
#
## A sample /etc/unicorn/my_app.conf
##
@heygambo
heygambo / gist:1031104
Created June 17, 2011 09:03
unicorn nginx files
We couldn’t find that file to show.
# verschiebt die alte RVM Installation
mv .rvm .rvm_old
# setzt den Pfad zu gcc
export CC=/usr/bin/gcc-4.2
# installiert RVM
bash < <(curl -s https://rvm.beginrescueend.com/install/rvm)
# installiert Ruby 1.9.2
# installiert imagemagcik
brew install imagemagick
# erstellt symlinks
sudo brew link imagemagick
# installiert homebrew openssl
brew install openssl
# erstellt symlinks
sudo brew link openssl
# installiert passenger
gem install passenger
# installiert Abhängigkeiten
@heygambo
heygambo / gist:1165931
Created August 23, 2011 17:27
Converts all JPGs in Folder using ImageMagick
find . -iname "*.jpg" -print0 | xargs -0 mogrify -resize 1400x -quality 75 -strip *
@heygambo
heygambo / gist:1168525
Created August 24, 2011 16:52
Firefox Sortable Scroll Bug Solution
var userAgent = navigator.userAgent.toLowerCase();
if(userAgent.match(/firefox/)) {
$( '#'+elm_id ).bind( "sortstart", function (event, ui) {
ui.helper.css('margin-top', $(window).scrollTop() );
});
$( '#'+elm_id ).bind( "sortbeforestop", function (event, ui) {
ui.helper.css('margin-top', 0 );
});
}
@heygambo
heygambo / make.log
Created September 30, 2011 16:14
Can't compile ruby-1.9.2-p290 in Lion
[2011-09-30 18:09:30] make
/usr/bin/gcc-4.2 -O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings -Wno-missing-field-initializers -Wshorten-64-to-32 -Wno-long-long -fno-common -pipe -I. -I.ext/include/x86_64-darwin11.1.0 -I./include -I. -DRUBY_EXPORT -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -o main.o -c main.c
/usr/bin/gcc-4.2 -O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings -Wno-missing-field-initializers -Wshorten-64-to-32 -Wno-long-long -fno-common -pipe -I. -I.ext/include/x86_64-darwin11.1.0 -I./include -I. -DRUBY_EXPORT -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -o dln.o -c dln.c
/usr/bin/gcc-4.2 -O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings -Wno-missing-field-initializers -Wshorten-64-to-32 -Wno-long-long -fno-common -pipe -I. -I.ext/include/x86_64-darwin11.1.0 -I./include -I. -DRUBY_EXPORT -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -o dmydln.o -c dmydln.c
/usr/bin/gcc-4.2 -O3 -ggdb -Wextra -Wno-unu