Skip to content

Instantly share code, notes, and snippets.

View tonussi's full-sized avatar

Lucas Tonussi tonussi

View GitHub Profile
@tonussi
tonussi / gist.html
Created March 30, 2012 02:47
wind simulation
$('#main').css('background', "#a8ad37");
var g = d3.select('svg')
.append('g')
.attr('transform', 'translate(' + $('#main').width()/2 + ', ' + 889 + ')');
var randomNumbers;
if ($('#main').data('randomNumbers')) {
randomNumbers = $('#main').data('randomNumbers');
} else {
@tonussi
tonussi / avi.js
Created July 29, 2012 16:03
Simple script that scans the orgDir directory and unpack all AVI files
var app = new Avidemux();
var ds = new DirectorySearch();
var orgDir;
var destDir;
var reg =new RegExp(".$");
/*
This is for Unix
For Windows change to
sep="\\";
reg2=new RegExp("\\.*\\");
@tonussi
tonussi / blogspot_to_jekyll.rb
Created August 4, 2012 18:05 — forked from kennym/blogspot_to_jekyll.rb
Migrate your blogger blog posts to jekyll.
#!/usr/bin/env ruby
#
# Convert blogger (blogspot) posts to jekyll posts
#
# Basic Usage
# -----------
#
# ./blogger_to_jekyll.rb feed_url
#
# where `feed_url` can have the following format:
@tonussi
tonussi / coderwall_widget_div.html
Created August 12, 2012 01:41 — forked from lp/coderwall_widget_div.html
HTML DIV for Coderwall Widget
<div id="coderwall_badges">
<script
type="text/javascript"
src="http://coderwall-widget.appspot.com/coderwallbadges.js/tonussi">
</script>
<script>
new CoderwallWidget({
'color':'#000',
'#fff':'#000',
'width':245,
@tonussi
tonussi / geek.scala
Last active October 8, 2015 11:58
geek code
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCS d- s+: a-- C ULC++ P+ L+++ E++ !W++(Wine) N++ !o K- !w !O !M+ V PS+ PE+ !Y+ !PGP- t+ !5 X+ !R- tv-- b- DI--- !D- G e(++)>++++$ h()>--- r>+++ y+(reset)>reset
------END GEEK CODE BLOCK------
@tonussi
tonussi / tonussi.css
Created August 21, 2012 16:17
tonussi.sass
@media screen, projection, print {
html, body { font: 300 100.01% "Helvetica Neue", Helvetica, Arial, sans-serif; margin-left: auto; margin-right: auto; width: 100%; height: 100%; line-height:1.1138em; text-rendering: optimizeLegibility; }
a, a * { color: #555; text-decoration: none; }
h, h1, h2, h3, h4, h5 { color: #000; font-size: 1.1em; margin-left: 1em; padding-right: 1.250em; padding-bottom: 2.250em; padding-top: 2.250em; color: #429745; }
p, p1, p2, p3 { display: block; margin-before: 5em; margin-after: 5em; margin-start: 3em; margin-end: .8em; right: .5em; left: .5em; padding: 0.250em; padding-top: 2em; padding-bottom: 1.250em; font-size: .875em; }
strong.very { color: #f00 }
p4, p5, p6 { display: block; margin-before: 5em; margin-after: 5em; margin-start: 3em; margin-end: .8em; right: .5em; left: .5em; padding: 0.250em; padding-top: 2em; padding-bottom: 1.250em; font-size: .875em; }
header { padding-top: 1em; padding-bottom: 1em; height: auto; margin-top: auto; margin-bottom: 1em; bott
@tonussi
tonussi / prob.r
Created September 10, 2012 02:01
prob
x=c(3,5,6,7,8)
y=c(10,14,20,18,55)
x+y
z=c(x,y)
sum(x)
mean(x)
var(x) #Like var this uses denominator n - 1.
sd(x)
power(sd(x))
plot(x,y)
@tonussi
tonussi / mealy.ino
Created October 28, 2012 03:19
mealy machine implemented with arduino and output leds
/*
* creativeoffice presents
* machine state of leds
* with start button
* a fancy simulation
*/
//espaco para declaracoes de variaveis globais
//variaveis podem ser declaradas localmente tambem
//cabe ao programador decidir a logica
@tonussi
tonussi / comportnote.pd
Created November 4, 2012 16:36
Interface between Arduino and Pd~ (PureData)
#N canvas 108 219 593 441 10;
#X msg 19 103 devices;
#X obj 122 120 comport 0 9600;
#X msg 19 74 close;
#X msg 19 26 devicename /dev/ttyACM0;
#X obj 146 262 noteout;
#X floatatom 216 182 0 0 0 0 - - -;
#X floatatom 169 182 0 0 0 0 - - -;
#X obj 300 405 print x1;
#X obj 32 409 print x2;
@tonussi
tonussi / SerialShifter.vhd
Created November 13, 2012 21:45
VHDL Components Description
library IEEE;
use ieee.std_logic_1164.all;
USE ieee.numeric_std.all;
entity SerialShifter is
port( clock,
reset,
start: in std_logic;
dataIn: in std_logic_vector(7 downto 0);
dataOut: out std_logic_vector(7 downto 0);