Skip to content

Instantly share code, notes, and snippets.

View alx's full-sized avatar
🌌
exploring

Alexandre Girard alx

🌌
exploring
View GitHub Profile
// =======
// =======
//
// Arduino Powermeter
//
// =======
// =======
//
// Use Arduino and a photoresistor LED to read impulsion from
// an electricity box while it blinks its consumption
#!/usr/bin/ruby
require 'net/http'
http = Net::HTTP.new('ddc.har2009.info', 8080)
path = '/DDCAnimationServer/index.ftl'
index = 150
class Flag
# Bash options
export HISTCONTROL=erasedups
export HISTSIZE=10000
shopt -s histappend
export TERM=linux
# Path
export PATH=/usr/local/bin:/Users/alx/.gem/ruby/1.8/bin:$PATH
export PATH=~/bin:/usr/local/sbin:/opt/local/bin/:/usr/local/git/bin:$PATH
export PATH=/System/Library/Frameworks/JavaVM.framework/Versions/1.6/Home/bin:$PATH
@alx
alx / cumple.pde
Created September 14, 2009 09:31
/*
El Cumpleaños de Mercedes
-- Mirar y Leer --
Aqui solo se lee la luz.
Despues de ver lo que he escrito el año pasado, no tengo mas tonterias a escribir en el papel.
-- Abrir y Juegar --
@database = SQLite3::Database.new( "first_bar.db" )
@database.execute( "create table bar_table (tag_id INTEGER PRIMARY KEY, username TEXT, credit NUMERIC, nb_beers NUMERIC);" )
# Admin tag
tag_in "d00219a440cf08b8" do
puts "Alx phone"
puts "select username to add credit:"
index = 1
@database.execute("select * from bar_table").each do |row|
puts "#{index}: #{row[1]}"
Tetalab: un hackerspace Toulousain
Après quelques mois d'existence, le Tetalab vient présenter ses projets en cours à Toulibre.
Arduino, Table Tangible, OpenCV, Telephone SIP, RFID, XMPP... tellement de jouets pour geeks, tellement peu de temps pour tout expériementer.
Le Tetalab est cet endroit où vous pourrez trouver du monde pour monter votre projet, boire des bières et allumer des LEDs!
Au programme de ce mercredi chez Toulibre: Qu'est-ce qu'un hackerspace et les particularités de celui de Toulouse? Quels sont les projets fun du moment, et comment s'amuser encore plus en se déplaçant chez les voisins?
require 'rubygems'
require 'httpclient'
Dir.glob("*.jpg").each do |image|
filepath = Dir.pwd << "/" << image
p "[Uploading] #{filepath}"
HTTPClient.post 'http://upload.bayimg.com/upload',
{:file => File.new(filepath),
:code => "please_be_kind",
:tags => "tetalab"}
// ==UserScript==
// @name BayImg.com - Sweet Interface 2.71
// @namespace Manix
// @include http://bayimg.com/*
// ==/UserScript==
var D = document;
////////////////////////////////////////////////////////////////////////////////////////////////////
cd /wp-content/blogs.dir/1/files/avatars/
ruby -e "Dir.glob('**/*.jpg').each{|file| File.rename(file,file.gsub('-full.jpg', '-bpfull.jpg'))}"
ruby -e "Dir.glob('**/*.jpg').each{|file| File.rename(file,file.gsub('-thumb.jpg', '-bpthumb.jpg'))}"
class User
include DataMapper::Resource
property :id, Serial
property :name, String
property :created_at, DateTime
has n, :tags
end