Skip to content

Instantly share code, notes, and snippets.

View camilleroux's full-sized avatar
🍪
Eating cookies

Camille Roux camilleroux

🍪
Eating cookies
View GitHub Profile
require 'matrix'
require 'benchmark'
def regress x, y, degree
x_data = x.map { |xi| (0..degree).map { |pow| (xi**pow).to_f } }
mx = Matrix[*x_data]
my = Matrix.column_vector(y)
((mx.t * mx).inv * mx.t * my).transpose.to_a[0]
@camilleroux
camilleroux / christmas_tree.rb
Created December 24, 2010 18:08
A Ruby code to draw a Christmas Tree in less than 140 character
((1..20).to_a+[6]*4).each{|i|puts ('#'*i*2).center(80)};puts;puts 'Merry Christmas'.center(80)
@camilleroux
camilleroux / bulk_follow_twitter.rb
Created May 20, 2011 13:58
Bulk Follow of Twitter accounts
require "rubygems"
require "twitter"
Twitter.configure do |config|
config.consumer_key = YOUR_CONSUMER_KEY
config.consumer_secret = YOUR_CONSUMER_SECRET
config.oauth_token = YOUR_OAUTH_TOKEN
config.oauth_token_secret = YOUR_OAUTH_TOKEN_SECRET
end
@camilleroux
camilleroux / gist:3782871
Created September 25, 2012 16:14
Date des prochains Human Talks 2012-2013

Les Human Talks ont lieu les 2eme mardis du mois

Voilà les dates de 2012-2013:

  • 16 octobre 2012 beta (exceptionnellement pas le 2eme)
  • 13 novembre 2012
  • 11 décembre 2012
  • 8 janvier 2013
  • 12 février 2013
  • 12 mars 2013
@camilleroux
camilleroux / robot.js
Created December 6, 2012 13:18
Camille
//FightCode can only understand your robot
//if its class is called Robot
var Robot = function(robot) {
};
Robot.prototype.onIdle = function(ev) {
var robot = ev.robot;
robot.rotateCannon(cannonRelativeAngle);
@camilleroux
camilleroux / gist:26a99dfa63c123bddbce
Created July 25, 2014 16:53
Modified and fixed Affililink
var addTagToEnd, universalCode;
universalCode = {
'amazon.co.uk': 'tag=',
'amazon.com': 'tag=',
'amazon.de': 'tag=',
'amazon.fr': 'tag=pragmaticentrepreneurs-21',
'javari.co.uk': 'tag=',
'javari.de': 'tag=',
'javari.fr': 'tag=pragmaticentrepreneurs-21',
'amazonsupply.com': 'tag=',

Keybase proof

I hereby claim:

  • I am camilleroux on github.
  • I am camilleroux (https://keybase.io/camilleroux) on keybase.
  • I have a public key whose fingerprint is BEA7 6CC6 C714 4CEF C10D FA2C 2D9C 7C3E CACA FBC6

To claim this, I am signing this object:

Setup Mac OS X

I'm in a hospital in Spain and my MacBook was stolen.

Hospital Commit

Now I bought a new one and need to configure it. I have an external hard drive that backup everything using Time Machine, but I don't want all the crap I had in the old one.

1. Run Software Update