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
<!doctype html> | |
<!--[if lt IE 7 ]> <html lang="fr" class="lang-fr no-js ie6"> <![endif]--> | |
<!--[if IE 7 ]> <html lang="fr" class="lang-fr no-js ie7"> <![endif]--> | |
<!--[if IE 8 ]> <html lang="fr" class="lang-fr no-js ie8"> <![endif]--> | |
<!--[if IE 9 ]> <html lang="fr" class="lang-fr no-js ie9"> <![endif]--> | |
<!--[if (gt IE 9)|!(IE)]><!--> <html lang="fr" class="lang-fr no-js"> <!--<![endif]--> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> |
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
# Alias | |
alias apache='sudo /opt/local/apache2/bin/apachectl' | |
alias mysqlstart='sudo /opt/local/bin/mysqld_safe5 &' | |
alias mysqlstop='sudo /opt/local/bin/mysqladmin5 -u root -p shutdown' | |
alias ls='ls -G' | |
alias ll='ls -hl' | |
# Sources | |
# Use (http://www.git-attitude.fr/2010/07/14/le-prompt-bash-qui-change-la-vie-avec-git/) | |
source "$HOME/.git-completion.bash" && |
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
#!/usr/bin/php | |
<?php | |
define('SUCCESS', "\033[32m".'OK'."\033[37m - "); | |
define('WARN', "\033[31m".'INFO'."\033[37m - "); | |
define('EOL', "\n"); | |
## FUNCTIONS | |
function pecho($string) {fwrite(STDOUT, $string);} |
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
#!/usr/bin/php | |
<?php | |
define('SUCCESS', "\033[32m".'OK'."\033[37m - "); | |
define('WARN', "\033[31m".'INFO'."\033[37m - "); | |
define('EOL', "\n"); | |
## FUNCTIONS | |
function pecho($string) {fwrite(STDOUT, $string);} |
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
<?php | |
/** | |
* Database Factory | |
* Use this factory for connections to external databases | |
* | |
* @version 1.0.0 | |
* @author Julien BREUX <julien.breux@prestashop.com> | |
*/ | |
class DbFactoryCore | |
{ |
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
# How to use: | |
# | |
# $ruby server.rb | |
# $curl --header "X-Company-Roles: manager" --header "X-Company-Roles: admin" http://localhost:2345/ | |
require 'socket' | |
require 'json' | |
server = TCPServer.new('localhost', 2345) |
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
gem rails _1.0.0_ --version | |
gem rails _2.0.0_ --version |
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
alias debian="docker run --rm -ti debian:jessie /bin/bash" | |
alias ubuntu="docker run --rm -ti ubuntu:jessie /bin/bash" |
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
#!/usr/bin/env bash | |
# Simple move this file into your Rails `script` folder. Also make sure you `chmod +x puma.sh`. | |
# Please modify the CONSTANT variables to fit your configurations. | |
# The script will start with config set by $PUMA_CONFIG_FILE by default | |
PUMA_CONFIG_FILE=config/puma.rb | |
PUMA_PID_FILE=tmp/pids/puma.pid | |
PUMA_SOCKET=tmp/sockets/puma.sock |
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
class Document < ActiveRecord::Base | |
belongs_to :parent, class_name: 'Document' | |
def self.get_ancestors(who) | |
@tree ||= [] | |
# @tree is instance variable of Document class object not document instance object | |
# so: Document.get_instance_variable('@tree') | |
if who.parent.nil? |