Skip to content

Instantly share code, notes, and snippets.

View devsigner's full-sized avatar

Cedric Darricau devsigner

  • France
View GitHub Profile
@devsigner
devsigner / config.ru
Created April 8, 2011 20:28
use rack with rails 2.3.8
# use rack with rails 2.3.8
# config.ru
require "config/environment"
use Rails::Rack::LogTailer
use Rails::Rack::Static
run ActionController::Dispatcher.new
@devsigner
devsigner / gist:1490392
Created December 17, 2011 14:46
Button CSS
/* TEMPLATE HTML
<a href="#" class="button orange">
<span class="corner_left"></span>
<span class="corner_right">
<span class="text">Connexion</span>
</span>
</a>
TEMPLATE IMAGE
<##
@devsigner
devsigner / gist:1490395
Created December 17, 2011 14:48
sass Buttons sample
/* **** BUTTON TEMPLATE *****
<a href="#" class="button orange">
<span class="corner_left"></span>
<span class="corner_right">
<span class="text">Connexion</span>
</span>
</a>
*/
@devsigner
devsigner / index.js.erb
Created December 17, 2011 21:16 — forked from ryanb/index.js.erb
Infinite scrolling solution covered in revised episode #114: http://railscasts.com/episodes/114-endless-page-revised
$('#products').append('<%= j render(@products) %>');
<% if @products.next_page %>
$('.pagination').replaceWith('<%= j will_paginate(@products) %>');
<% else %>
$('.pagination').remove();
<% end %>
@devsigner
devsigner / ovhfact.rb
Created January 20, 2012 23:02 — forked from solisoft/ovhfact.rb
OVH Invoices
#!/usr/bin/ruby
# Require:
# - linux or Mac
# - ruby 1.8.7
# - Gem soap4r
# - curl
#
# Usage :
# ruby ovhfact.rb 2011
#
@devsigner
devsigner / rbenv-install-system-wide.sh
Created March 28, 2012 09:52 — forked from v1nc3ntlaw/rbenv-install-system-wide.sh
rbenv install ruby 1.9.3-p125 on Debian 6 Squeeze
# Update, upgrade and install development tools:
apt-get update
apt-get -y upgrade
apt-get -y install build-essential git-core curl libssl-dev \
libreadline5 libreadline5-dev \
zlib1g zlib1g-dev \
libmysqlclient-dev \
libcurl4-openssl-dev \
libxslt-dev libxml2-dev
@devsigner
devsigner / hack.sh
Created March 31, 2012 12:15 — forked from erikh/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@devsigner
devsigner / gist:3965107
Created October 27, 2012 15:40 — forked from nhocki/gist:1164315
Reverse proxy for passenger in apache server
# In the apps root directory run
# http://blog.phusion.nl/2010/09/21/phusion-passenger-running-multiple-ruby-versions/
# passenger start -a localhost -p 3000 -e production -d
<VirtualHost *:80>
ServerName ranking.timehub.net
DocumentRoot /the/path/to/the/app/public
PassengerEnabled off
ProxyPass / http://localhost:3000/
ProxyPassReverse / http://localhost:3000/
@devsigner
devsigner / setup_load_paths.rb
Created October 29, 2012 17:07
in config/ : set RVM version for passneger.
if ENV['MY_RUBY_HOME'] && ENV['MY_RUBY_HOME'].include?('rvm')
begin
gems_path = ENV['MY_RUBY_HOME'].split(/@/)[0].sub(/rubies/,'gems')
ENV['GEM_PATH'] = "#{gems_path}:#{gems_path}@global"
require 'rvm'
RVM.use_from_path! File.dirname(File.dirname(__FILE__))
rescue LoadError
raise "RVM gem is currently unavailable."
end
end

Console VIM and Tmux setup compatible with Mac OS X and Linux.

Disclaimer: This file is called .a_README.markdown so that it'll appear first in the gist view (sorry for the horrible name)

Installation

Because this script prompts for user input, you have to execute it in a bit of an odd way. From a new command prompt simply copy and paste the following command and press return: