Skip to content

Instantly share code, notes, and snippets.

View AdrienGiboire's full-sized avatar
🥦
Plant-fueled, you can't test me!

Adrien AdrienGiboire

🥦
Plant-fueled, you can't test me!
View GitHub Profile
if (
(function(){
var el = document.createElement('div'),
bs = 'backgroundSize',
ubs = bs.charAt(0).toUpperCase() + bs.substr(1),
props = [bs, 'Webkit' + ubs, 'Moz' + ubs, 'O' + ubs];
for ( var i in props ) {
if ( el.style[props[i]] !== undefined ) {
return true;
@AdrienGiboire
AdrienGiboire / gist:adc7ef08c8f8b5089dd4
Last active September 10, 2015 15:02 — forked from Huluk/gist:5117702
Open Files with Terminal Vim by default [mac, iterm]
If you want your terminal vim to open files you double click, follow the following steps (MacOS only):
1. Open Automator
2. Select Application
3. Copy the attached file
4. Save and set as default for opening files
Multiple files are opened in vim tabs.
If there is already a vim instance running, files are opened in it.
# This file should contain all the record creation needed to seed the database with its default values.
# The data can then be loaded with the rake db:seed (or created alongside the db with db:setup).
[User, Categorization, Category, Micropost].each(&:delete_all)
User.create({
:username => 'plume',
:email => 'adrien.giboire@gmail.com',
:password => 'adichris',
:password_confirmation => 'adichris'
@AdrienGiboire
AdrienGiboire / gist:1071934
Created July 8, 2011 14:15
Installation de la gemme MySQL sur Ubuntu
# Paquets mysql et dev nécessaires pour la gemme mysql :
sudo apt-get install mysql-server mysql-client libmysqlclient-dev libmysqld-dev
# Nécessaire pouir ruby-debug :
sudo apt-get install ruby1.8-dev
# Les paquets Rails incluent pas mal de bonus que vous seriez susceptibles d'apprécier :
sudo gem install rails sqlite3 ruby-debug
# Et enfin, la gemme mysql:
sudo gem install mysql
@AdrienGiboire
AdrienGiboire / hello_world.rb
Created July 9, 2011 10:41
Hello_World.rb with Sinatra
require 'sinatra'
get '/' do
'Hello world!'
end
@AdrienGiboire
AdrienGiboire / hello_name.rb
Created July 9, 2011 10:44
How to get hello name with Sinatra
get '/hello/:name' do
"Hello #{params[:name]}!"
end
require 'sass'
get '/stylesheet.css' do
scss :stylesheet
end
require 'haml'
get '/' do
haml :index
end
@AdrienGiboire
AdrienGiboire / gist:1073498
Created July 9, 2011 10:42
Routes Explanation with Sinatra
get '/' do
'Montrer quelque chose'
end
post '/' do
'Enregistrer quelque chose'
end
put '/' do
'Mettre à jour quelque chose'
ActiveRecord::Base.establish_connection(
:adapter => 'sqlite3',
:database => 'sinatra_application.sqlite3.db'
)