This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'sinatra' | |
get '/' do | |
'Hello world!' | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
get '/hello/:name' do | |
"Hello #{params[:name]}!" | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'sass' | |
get '/stylesheet.css' do | |
scss :stylesheet | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'haml' | |
get '/' do | |
haml :index | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
get '/' do | |
'Montrer quelque chose' | |
end | |
post '/' do | |
'Enregistrer quelque chose' | |
end | |
put '/' do | |
'Mettre à jour quelque chose' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ActiveRecord::Base.establish_connection( | |
:adapter => 'sqlite3', | |
:database => 'sinatra_application.sqlite3.db' | |
) |
OlderNewer