du code
point d'eclamation
du texte normal avec un retour.
a la ligne
| # Create a user in RIAK & RIAKCS | |
| # Get the user | |
| Me = User.find_by_index(:email, "[email protected]") | |
| Me = User.find '52820a5994da266b19000002' | |
| # Or create a new one | |
| Me = User.new username:'Micka2', email:'[email protected]', 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) |
| 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 |
| import os | |
| from subprocess import call | |
| import time | |
| from datetime import datetime | |
| import calendar | |
| import re | |
| ## |
| #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) |
| def snail(array) | |
| x = 0 | |
| y = 0 | |
| done = [] | |
| indexes = [[1,0],[0,1],[-1,0],[0,-1]].cycle | |
| delta = indexes.next | |
| res = [] | |
| array.flatten.length.times do |n| | |
| res << array[y][x] | |
| done << x.to_s+y.to_s |
| #!/usr/bin/env python2 | |
| import os | |
| def callfn(fns, name, path, dry): | |
| if isinstance(fns, list): | |
| for fn in fns: | |
| if hasattr(fn, '__call__'): | |
| fn(name, path, dry) | |
| elif hasattr(fns, '__call__'): | |
| fns(name, path, dry) |
| 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 |
Substitute riak-cs by netcat to vatch the sent request
$> nc -l 127.0.0.1 8080
PUT /53208b5294da268379000001?AWSAccessKeyId=O_5H9U1UTJNVB5MDNM0O&Expires=1394677746&Signature=IjMEUg%2BH%2FP7SP5nx4KW7gXJ6h8g%3D HTTP/1.1
Host: 52aed41a94da26d8fa000001.data.riak.dev
Content-Length: 2831
x-amz-acl: public-read
...| admin.factory('$socket', ['$rootScope', function ($rootScope) { | |
| if (typeof io != 'undefined') | |
| var socket = io.connect(); | |
| return { | |
| connect: function (url) { | |
| if (typeof io != 'undefined') | |
| socket = io.connect(url); | |
| }, | |
| on: function (eventName, callback) { | |
| if (typeof socket != 'undefined') |