Skip to content

Instantly share code, notes, and snippets.

View tonussi's full-sized avatar

Lucas Tonussi tonussi

View GitHub Profile
@dtiemann83
dtiemann83 / gitautotag.sh
Last active September 17, 2024 02:19
A quick BASH script to automatically add a git tag by incrementing --major --minor --bug version, based on (most recent) previous tag.
#!/bin/bash
CURTAG=`git describe --abbrev=0 --tags`;
CURTAG="${CURTAG/v/}"
IFS='.' read -a vers <<< "$CURTAG"
MAJ=${vers[0]}
MIN=${vers[1]}
BUG=${vers[2]}
@awangenh
awangenh / ForwardDiff_Foley_vanDam.pde
Last active November 23, 2018 23:24
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 *
@automata
automata / irc2espeak.html
Created March 14, 2013 00:18
irc2espeak.py
<html>
<head>
<title> cibeleborg </title>
<style>
body {
background: url("http://24.media.tumblr.com/tumblr_lgjl1fsev41qh644lo1_500.jpg") repeat;
}
</style>
</head>
<body>
@tonussi
tonussi / factorial.py
Created November 22, 2012 17:37 — forked from ghoseb/factorial.py
The evolution of a Python Programmer
#Newbie programmer
def factorial(x):
if x == 0:
return 1
else:
return x * factorial(x - 1)
print factorial(6)
#First year programmer, studied Pascal
@zumbojo
zumbojo / bijective.rb
Created July 9, 2011 22:09
Simple bijective function (base(n) encode/decode)
# Simple bijective function
# Basically encodes any integer into a base(n) string,
# where n is ALPHABET.length.
# Based on pseudocode from http://stackoverflow.com/questions/742013/how-to-code-a-url-shortener/742047#742047
ALPHABET =
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789".split(//)
# make your own alphabet using:
# (('a'..'z').to_a + ('A'..'Z').to_a + (0..9).to_a).shuffle.join