Skip to content

Instantly share code, notes, and snippets.

View llacroix's full-sized avatar

Loïc Faure-Lacroix llacroix

View GitHub Profile
@llacroix
llacroix / hopa.rb
Created August 20, 2014 09:53
Number serie
def split_num(arr)
arr.split("").map {|c|
c.to_i
}
.inject([]){|accumulator, value|
# puts "[#{accumulator}, #{value}]"
if accumulator.size > 0 and accumulator[-1][0] == value
accumulator[-1][1] += 1
else
@llacroix
llacroix / gist:6844267
Created October 5, 2013 18:11
Scheme bezier of n order
(require-extension srfi-4 glm)
(require-extension list-utils)
(require-extension statistics)
(define (mapi p l)
(let loop ((l l) (i 0) (r '()))
(if (pair? l)
(loop (cdr l) (+ i 1) (cons (p (car l) i) r))
(reverse r))))
@llacroix
llacroix / xmms2.rb
Created September 23, 2012 16:36
Brew xmms2 formula
require 'formula'
# Documentation: https://github.com/mxcl/homebrew/wiki/Formula-Cookbook
# PLEASE REMOVE ALL GENERATED COMMENTS BEFORE SUBMITTING YOUR PULL REQUEST!
class Xmms2 < Formula
homepage 'http://xmms2.org/wiki/Main_Page'
url 'http://git.xmms2.org/xmms2/xmms2-devel/snapshot/6e6a9635f04c3e2c7af8dd9336ca6006d89f8114.tar.gz'
sha1 'b8ade9e2c511280fe98ed81df438e357b22f8157'
version '0.8.1'