Now into http://nicolas-brousse.github.io/ubuntu-install-and-tips
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 | |
$post = new Post(); | |
$post->setTitle('Awesome title'); | |
$post->setContent('My very awesome article'); | |
$comment = new Comment(); | |
$comment->setAuthor('Alice'); | |
$comment->setText('That\'s a very great article!'); |
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
cask :v1 => 'common-group' do | |
version :latest | |
sha256 :no_check | |
# Binaries | |
depends_on :formula => 'wget' | |
depends_on :formula => 'curl' | |
depends_on :formula => 'whois' | |
depends_on :formula => 'zsh' |
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
namespace :carrierwave do | |
desc 'Reprocesses Carrier Wave file versions of a given model.' | |
task reprocess_all: :environment do | |
ActiveRecord::Base.descendants.each do |m| | |
next if m.uploaders.empty? | |
puts "Reprocess #{m.name}" | |
m.all.each do |entry| |
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 | |
$lines = file($argv[1], FILE_IGNORE_NEW_LINES); | |
$buffer = ''; | |
$requests = array(); | |
foreach ($lines as $line) | |
{ | |
if (empty($line)) { | |
$requests[] = trim($buffer); |
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 | |
class Benchmark | |
{ | |
protected $title = null; | |
protected $startData = null; | |
protected $reports = array(); | |
const TEXT_FORMAT_HTML = 'html'; | |
const TEXT_FORMAT_PlAIN = 'plain'; |
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 | |
namespace Opsone\Util; | |
class Frame | |
{ | |
protected $point; | |
protected $size; | |
public function __construct(Point $point, Size $size) |
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
Show hidden characters
{ | |
"create_window_at_startup": false, | |
"detect_slow_plugins": false, | |
"draw_white_space": "all", | |
"ensure_newline_at_eof_on_save": true, | |
"font_size": 11.0, | |
"highlight_line": true, | |
"highlight_modified_tabs": true, | |
"hot_exit": false, | |
"ignored_packages": |
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 | |
if [ -f "$rvm_path/scripts/rvm" ] && [ -f ".ruby-version" ] && [ -f ".ruby-gemset" ]; then | |
source "$rvm_path/scripts/rvm" | |
ruby_version=`cat .ruby-version` | |
ruby_gemset=`cat .ruby-gemset` | |
environment_id="$ruby_version@$ruby_gemset" | |
rvm use "$environment_id" || { |
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
#! /bin/sh | |
# | |
# Create new empty rails application with rvm | |
# Author: Nicolas Brousse <[email protected]> | |
# Date: 2011-11-17 00:18:10 UTC | |
# | |
# create_rails [version] [gemset_name] PATH | |
# | |
set -e |