Skip to content

Instantly share code, notes, and snippets.

View alx's full-sized avatar
🌌
exploring

Alexandre Girard alx

🌌
exploring
View GitHub Profile
@alx
alx / sigmajs_modularity..js
Created April 8, 2013 15:03
Sigma.js Modularity coloration plugin. Depends on d3js for d3.scale.category20() call.
$(document).ready(function() {
(function(){
var Modularity = function(sig) {
sigma.classes.Cascade.call(this);
var self = this,
domains = [];
['code', 'art', 'boot', 'mix', 'verse'].each { |hack| re(hack) }
@alx
alx / output.log
Created June 13, 2012 18:10
pws openssl debug log
~$ brew install openssl
==> Downloading http://openssl.org/source/openssl-1.0.1c.tar.gz
Already downloaded: /Users/alx/Library/Caches/Homebrew/openssl-1.0.1c.tar.gz
==> perl ./Configure --prefix=/usr/local/Cellar/openssl/1.0.1c --openssldir=/usr/local/etc/openssl zlib-dynamic shared darwin64-x86_64-cc
==> make
==> make test
==> make install MANDIR=/usr/local/Cellar/openssl/1.0.1c/share/man MANSUFFIX=ssl
==> Caveats
This formula is keg-only, so it was not symlinked into /usr/local.
@alx
alx / output.log
Created June 12, 2012 06:18
rvm 1.9.3-p194 && cd ~/.rvm/src/ruby-1.9.3-p194/ext/openssl && ruby extconf.rb
~$ rvm 1.9.3-p194 && cd ~/.rvm/src/ruby-1.9.3-p194/ext/openssl && ruby extconf.rb
=== OpenSSL for Ruby configurator ===
=== Checking for system dependent stuff... ===
checking for t_open() in -lnsl... no
checking for socket() in -lsocket... no
checking for assert.h... yes
=== Checking for required stuff... ===
checking for openssl/ssl.h... yes
checking for openssl/conf_api.h... yes
checking for rb_str_set_len() in ruby.h... yes
@alx
alx / credentials.log
Created June 7, 2012 22:57
github asking for credentials during git push
~$ git clone https://github.com/tetalab/deux-mille.git
Cloning into 'deux-mille'...
remote: Counting objects: 6, done.
remote: Compressing objects: 100% (4/4), done.
remote: Total 6 (delta 0), reused 6 (delta 0)
Unpacking objects: 100% (6/6), done.
~$ cd deux-mille/
deux-mille (master)$ cp ../code/deux-mille/index.html .
deux-mille (master)$ gco "remove unused html"
[master 89b27d0] remove unused html
@alx
alx / nginx.conf
Created May 30, 2012 10:53
rtfm and pad nginx configuration
# thsf.tetalab.org
server {
listen 80;
server_name thsf.tetalab.org;
access_log /var/log/nginx/thsf.access.log;
error_log /var/log/nginx/thsf.error.log;
location / {
root /var/www/thsf-2012;
#
# input:
#
# >> log
# => [{:time=>201201, :x=>2}, {:time=>201201, :y=>7}, {:time=>201201, :z=>2}, {:time=>201202, :a=>3}, {:time=>201202, :b=>4}, {:time=>201202, :c=>0}]
#
result = {}
log.each do |line|
result[line[:time]] = result[line[:time]].nil? ? line : result[line[:time]].merge(line)
@alx
alx / ledpong_random.js
Created April 6, 2012 16:14
Ledpong : random with nodejs
var SerialPort = require("serialport").SerialPort;
var serialPort;
try {
serialPort = new SerialPort("/dev/ttyACM0", { baudrate: 38400 });
} catch(e) {
console.error(e.stack);
serialPort = { write: console.log };
}
setInterval(function() {
@alx
alx / pypong.py
Created April 6, 2012 14:48
PyPong - Ledpgon with Python
import serial
import time
class pypong:
def __init__(self, port="/dev/ttyACM0", baudrate=38400):
self.__s = serial.Serial(port=port, baudrate=baudrate)
def send_text(self, data):
if len(data) == 432:
try:
@alx
alx / tetaneutral_box.scad
Created March 24, 2012 15:05
Tetaneutral box
use <write.scad>
// Define box size
// it will compute the hole to leave inside these box
// depending on the wall size
box_size = [120,30,90];
wall_size = 1.6;
inner_size = [
box_size[0] - (wall_size * 2),
box_size[1] - (wall_size * 2),