Skip to content

Instantly share code, notes, and snippets.

View makevoid's full-sized avatar

Francesco 'makevoid' Canessa makevoid

View GitHub Profile
@makevoid
makevoid / Marlin.h
Created July 19, 2013 00:35
Marlin.h sanguinololu fix
// sanguinololu fix - https://code.google.com/p/sanguino/issues/detail?id=27
#if ARDUINO >= 100
#if defined(__AVR_ATmega644P__)
//#include "WProgram.h"
//#else
#include "Arduino.h"
#endif
//#else
//#include "WProgram.h"
@makevoid
makevoid / peak_wheel_mount.scad
Created July 12, 2013 15:01
Geeksphone Peak (phone) steering wheel mount (sizes are configurable), you need to switch the first variable to generate both pieces. Wheel sizes are for a Toyota Yaris TS1.5 steering wheel
// stl generation
part1 = true; // (switch to false for part2), you'll need both for a phone wheel mount
// parts configuration
// phone size
ph_x = 62.4;
ph_y = 134.1;
ph_z = 12.1;
@makevoid
makevoid / celluruby.rb
Created July 1, 2013 14:41
Celluloid test playground
require 'celluloid'
DB = { count: 0 }
class Actor
include Celluloid
def do_stuff
# sleep 1
@makevoid
makevoid / index.html
Last active December 17, 2015 04:28
Mobile App Hello World
<meta name="viewport" content="width=device-width">
<script>
var main = function(){
log("hello world")
}
var log = function(string){
var body = document.getElementsByTagName("body")[0]
body.innerHTML = body.innerHTML+string+"<br>"
}
@makevoid
makevoid / lapse_rename.rb
Created May 4, 2013 17:06
Time lapse tools
# run ruby lapse_rename.rb
# then:
# avconv -f image2 -i lapse_%04d.jpg -s hd1080 -threads 8 out.mp4
files = Dir.glob("*.JPG")
files.sort.each_with_index do |file, idx|
idx += 1
@makevoid
makevoid / jsdl.rb
Created April 3, 2013 11:53
jsdl - Javascript Libraries Downloader
#! /usr/bin/ruby
# jsdl
#
# download js libraries for you
#
# usage: jsdl jquery
# configs
@makevoid
makevoid / app_delegate.rb
Last active December 15, 2015 06:09
Hello (UIViewController) world - RubyMotion
class AppDelegate
def application(application, didFinishLaunchingWithOptions:launchOptions)
player_controller = MainController.alloc.init
window = UIWindow.alloc.initWithFrame UIScreen.mainScreen.bounds
window.rootViewController = player_controller
window.rootViewController.wantsFullScreenLayout = true
window.makeKeyAndVisible
true
end
end
@makevoid
makevoid / mhash.rb
Last active December 14, 2015 19:59
Mhash: defines accessors methods for each hash key
# Mhash
#
# defines accessors methods for each hash key
#
#
# why?
# to enhance syntactic sugar and to let the refactoring transition to a real object easier
#
# usage:
#
@makevoid
makevoid / obfuscator.rb
Created February 12, 2013 16:50
Script to replace sensible database datas
# obfuscates the db removing sensible values
# ruby obfuscate.rb
# mysqldump -u root gbc > gbc_safe.sql
# tar cvfz gbc_safe.tgz gbc_safe.sql
require 'bundler/setup'
Bundler.require :default
class Obfuscate
@makevoid
makevoid / Readme.md
Created December 14, 2012 02:51
use Mechanize persisting the cookie jar

EptiMecha

example on how to use mechanize with cookie jars, basically:

agent.cookie_jar.save_as "cookies.yml"
agent.cookie_jar.load "cookies.yml"

to try it:

  • download this zip