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
### Keybase proof | |
I hereby claim: | |
* I am rachid on github. | |
* I am rachidq (https://keybase.io/rachidq) on keybase. | |
* I have a public key ASCFlAq_Lyk-_j8IGpqP9LsdaobP6BsV4D_3hGjc5QkGtAo | |
To claim this, I am signing this object: |
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
defp from_model(resource) when is_map(resource) do | |
resource.__struct__ | |
|> extract | |
end | |
defp from_model(resource) do | |
resource | |
|> extract | |
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
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
appName:'Ember Twiddle' | |
}); | |
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
set nocompatible " be iMproved | |
filetype off " required! | |
set rtp+=~/.vim/bundle/vundle/ | |
call vundle#rc() | |
Bundle 'gmarik/vundle' | |
Bundle 'vim-scripts/renamer.vim' | |
" Git integration |
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
unbind % | |
bind \ split-window -h | |
bind - split-window -v | |
set -g mode-mouse on | |
set -g mouse-select-pane on | |
set -g mouse-select-window on | |
set -g default-terminal "screen-256color" | |
set -s escape-time 0 | |
set -g renumber-windows on |
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 'open-uri' | |
require 'nokogiri' | |
USER_AGENTS = [ | |
'Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3', | |
'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 2.0.50727)', | |
'Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.3) Gecko/20100423 Ubuntu/10.04 (lucid) Firefox/3.6.3', | |
'Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_3; en-US) AppleWebKit/533.4 (KHTML, like Gecko) Chrome/5.0.375.70 Safari/533.4', | |
'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.2) Gecko/20100323 Namoroka/3.6.2', |
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
# in the rails default Model | |
class Student < ActiveRecord::Base | |
default_scope :order => 'lastname ASC' | |
end | |
#or in an active admin DSL model | |
ActiveAdmin.register Student do | |
scope :all, :default => true do |students| |
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
# install rails3 with passenger gem | |
require 'bundler/capistrano' | |
# first setup your user on your vps, adjust the recipe and do the following commands | |
# cap deploy:setup | |
# cap deploy:cold | |
# cap deploy | |
set :application, "app-name" #will be used to for you git repository appname |
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
# use the ubuntu machine gem | |
# tested with MacOS should probably also work fine with unix based machines | |
require 'capistrano/ext/ubuntu-machine' | |
# ####################################### | |
# HOSTING PROVIDER CONFIGURATION | |
# Those tasks have been tested with severa hosting providers | |
# and sometimes tasks are specific to those providers |
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 recipe works for Windows users | |
# use the ubuntu machine gem | |
require 'capistrano/ext/ubuntu-machine' | |
# ####################################### | |
# HOSTING PROVIDER CONFIGURATION | |
# Those tasks have been tested with severa hosting providers | |
# and sometimes tasks are specific to those providers | |
set :hosting_provider, "slicehost" # currently supported : ovh-rps, ovh-dedie, slicehost |