Homebrew is a great little package manager for OS X. If you haven't already, installing it is pretty easy:
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
#Code à mettre:
(function(e){function t(){var t=window.module.lp.form.data;var n=t.validationMessages;var r=t.validationRules;this.changeTitle=function(n){e(function(){e("#"+t.errorContainerId).find("div.error").text(n)})};this.changeField=function(e,t,i){if(!n[e])return;n[e].required=t;if(i&&r[e].email)n[e].email=i;if(i&&r[e].phone)n[e].phone=i}}window.errors=new t(lp.jQuery)})(lp.jQuery)
$(function() {
setTimeout(function(){
lp.jQuery.validator.addMethod("phone", function(phone_number, element)
{
phone_number = phone_number.replace(/\s+/g, "");
wget http://nginx.org/download/nginx-1.4.5.tar.gz | |
tar xzf nginx-1.4.5.tar.gz | |
wget http://zlib.net/zlib-1.2.8.tar.gz | |
tar xzf zlib-1.2.8.tar.gz | |
wget http://downloads.sourceforge.net/project/pcre/pcre/8.34/pcre-8.34.tar.bz2?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fpcre%2Ffiles%2Fpcre%2F8.34%2F&ts=1393362418&use_mirror=kent | |
mv pcre-8.34.tar.bz2\?r\=http\:%2F%2Fsourceforge.net%2Fprojects%2Fpcre%2Ffiles%2Fpcre%2F8.34%2F pcre-8.34.tar.bz2 | |
tar xjf pcre-8.34.tar.bz2 |
#Subject | |
#Find the sum of the digits of all the numbers from 1 to N (both ends included). | |
#For N = 10 the sum is 1+2+3+4+5+6+7+8+9+(1+0) = 46 | |
#For N = 11 the sum is 1+2+3+4+5+6+7+8+9+(1+0)+(1+1) = 48 | |
#For N = 12 the sum is 1+2+3+4+5+6+7+8+9+(1+0)+(1+1) +(1+2)= 51 | |
#Supported Ruby version is 1.9.3 | |
#Tests | |
it 'should' do | |
Test.assert_equals(solution(10), 46) |
import os | |
from subprocess import call | |
import time | |
from datetime import datetime | |
import calendar | |
import re | |
## |
wget http://www.tortall.net/projects/yasm/releases/yasm-1.2.0.tar.gz | |
tar xzvf yasm-1.2.0.tar.gz | |
cd yasm-1.2.0 | |
./configure | |
apt-get remove ffmpeg x264 libav-tools libvpx-dev libx264-dev yasm | |
./configure | |
make | |
sudo checkinstall --pkgname=yasm --pkgversion="1.2.0" --backup=no --deldoc=yes --fstrans=no --default | |
apt-get -y install autoconf automake build-essential checkinstall git libass-dev libfaac-dev libgpac-dev libmp3lame-dev libopencore-amrnb-dev libopencore-amrwb-dev librtmp-dev libspeex-dev libtheora-dev libtool libvorbis-dev pkg-config texi2html zlib1g-dev | |
aptitude install checkinstall |
# Create a user in RIAK & RIAKCS | |
# Get the user | |
Me = User.find_by_index(:email, "mickael3@beingenious.com") | |
Me = User.find '52820a5994da266b19000002' | |
# Or create a new one | |
Me = User.new username:'Micka2', email:'mickael2@beingenious.com', firstname:'micka2', lastname:'cassy2', password:'testtest2', password_confirmation:'testtest2' | |
Me.save | |
# In RIAKCS, Use FOG | |
# Instanciate the Fog API to go through RIAKCS | |
s3 = Fog::Storage.new RiakCS::BucketManager.get_credentials(Me.key_id, Me.key_secret) |
When hosting our web applications, we often have one public IP
address (i.e., an IP address visible to the outside world)
using which we want to host multiple web apps. For example, one
may wants to host three different web apps respectively for
example1.com
, example2.com
, and example1.com/images
on
the same machine using a single IP address.
How can we do that? Well, the good news is Internet browsers
#capybara_helper.rb
require 'rails_helper'
require 'capybara/rspec'
Dir[Rails.root.join("spec/support/**/*.rb")].each { |f| require f }
RSpec.configure do |config|
config.extend FeatureMacros, :type => :feature
Capybara.javascript_driver = :webkit