Skip to content

Instantly share code, notes, and snippets.

View tonussi's full-sized avatar

Lucas Tonussi tonussi

View GitHub Profile
@tonussi
tonussi / partitioninfo.c
Created May 20, 2016 14:58
partitioninfo.c
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
 
#define SECTOR_SIZE 512
#define MBR_SIZE SECTOR_SIZE
#define MBR_DISK_SIGNATURE_OFFSET 440
#define MBR_DISK_SIGNATURE_SIZE 4
@tonussi
tonussi / ForwardDiff_Foley_vanDam.pde
Created May 10, 2016 23:21 — forked from awangenh/ForwardDiff_Foley_vanDam.pde
COMPUTE AND DRAW A BICUBIC SURFACE PATCH USING FORWARD DIFFERENCES - This code implements and provides corrections to the algorithm named DrawSurfaceFwdDif presented in Fig.11.46 at page 525 of the book Computer Graphics - Principles and Practice 2.ed in C by James D.Foley et.al.
/* ============================================================================= *
* COMPUTE AND DRAW A BICUBIC SURFACE PATCH USING FORWARD DIFFERENCES *
* *
* This code implements and provides corrections to the algorithm named *
* DrawSurfaceFwdDif presented in Fig.11.46 at page 525 of the book *
* Computer Graphics - Principles and Practice 2.ed in C by Jamed D.Foley et.al. *
* This algorithm was neither corrected nor repeated in the 3rd (present) *
* edition of Foley et.al.'s book. *
* *
* The algorithm, as stated in the book, does not work: There is one error and *
@tonussi
tonussi / download.sh
Created March 10, 2016 02:15
download.sh
#!/bin/bash
# Script
# Download things in a numeric pattern of links
# Author: Lucas Tonussi <[email protected]>
# Usage
# bash download.sh <cota_inferior> <cota_superior> <regex> <output_name>
# $1 $2 $3 $4
link=""
@tonussi
tonussi / config.json
Created January 5, 2016 07:37 — forked from anonymous/config.json
Bootstrap Customizer Config
{
"vars": {
"@gray-base": "#000",
"@gray-darker": "lighten(@gray-base, 13.5%)",
"@gray-dark": "lighten(@gray-base, 20%)",
"@gray": "lighten(@gray-base, 33.5%)",
"@gray-light": "lighten(@gray-base, 46.7%)",
"@gray-lighter": "lighten(@gray-base, 93.5%)",
"@brand-primary": "darken(#428bca, 6.5%)",
"@brand-success": "#5cb85c",
@tonussi
tonussi / duplessis_part1.str
Created August 3, 2015 11:39
Archaeological Discoveries in Bible Lands - Part 1 - Digging Up The Past - Francois DuPlessis
1
00:00:00,906 --> 00:00:08,457
Grandes Descobertas!
2
00:00:12,079 --> 00:00:16,012
Desvende!
3
00:00:16,461 --> 00:00:19,039
@tonussi
tonussi / fib.asm
Created March 26, 2015 10:48
fib.asm
.text
.globl main
main:
# int fib (int n)
# if (n == 0) return 0;
# elif (n == 1) return 1;
# else return fib(n - 1) + fib(n - 2);
@tonussi
tonussi / class.js
Last active August 29, 2015 14:09
como escrever melhor
function Filho(nodo_filho, filho_esquerda, filho_direita) {
this.nodo_filho = nodo_filho;
this.filho_esquerda = filho_esquerda;
this.filho_direita = filho_direita;
}
Filho.class_filho.prototype.constroiAutomatoFND = function () {
var nodo_filho = new Parenteses(0, -1, 1024, this.nodo_filho);
if (!this.filho_esquerda) {
@tonussi
tonussi / captura.js
Created November 8, 2014 14:00
captura.js
captura_simbolos: function () {
var simbolos = [];
for (var i = 0; i < this.transicoes.length; i++) {
var tr = this.transicoes[i];
for (var j = tr.lb; j < tr.ub; j++) {
simbolos.push(j);
}
}
}
@tonussi
tonussi / foreman.rb
Last active August 29, 2015 14:08
foreman.rb
[lucastonussi:/home/lucastonussi/git/lyrebird] master(+155/-64,9) 16 ± foreman start
10:45:22 web.1 | started with pid 3736
10:45:23 web.1 | Example app listening at http://0.0.0.0:5000
10:45:27 web.1 | {}
10:45:28 web.1 | GET / 200 795.521 ms - 818
10:45:28 web.1 | GET /stylesheets/style.css 200 4.069 ms - 2794
10:45:31 web.1 | {}
10:45:31 web.1 | GET /regex 200 40.046 ms - 1686
10:45:31 web.1 | GET /stylesheets/style.css 200 1.375 ms - 2794
@tonussi
tonussi / erro.js
Created November 8, 2014 03:01
erro
Not Found
404
Error: Not Found
at app.use.res.render.message (/home/lucastonussi/git/lyrebird/app.js:69:15)
at Layer.handle [as handle_request] (/home/lucastonussi/git/lyrebird/node_modules/express/lib/router/layer.js:82:5)
at trim_prefix (/home/lucastonussi/git/lyrebird/node_modules/express/lib/router/index.js:270:13)
at /home/lucastonussi/git/lyrebird/node_modules/express/lib/router/index.js:237:9
at Function.proto.process_params (/home/lucastonussi/git/lyrebird/node_modules/express/lib/router/index.js:312:12)
at /home/lucastonussi/git/lyrebird/node_modules/express/lib/router/index.js:228:12