Skip to content

Instantly share code, notes, and snippets.

View patriciogonzalezvivo's full-sized avatar

Patricio Gonzalez Vivo patriciogonzalezvivo

View GitHub Profile
@banksean
banksean / perlin-noise-classical.js
Created February 15, 2010 10:00
two Perlin noise generators in javascript. The simplex version is about 10% faster (in Chrome at least, haven't tried other browsers)
// Ported from Stefan Gustavson's java implementation
// http://staffwww.itn.liu.se/~stegu/simplexnoise/simplexnoise.pdf
// Read Stefan's excellent paper for details on how this code works.
//
// Sean McCullough banksean@gmail.com
/**
* You can pass in a random number generator object if you like.
* It is assumed to have a random() method.
*/
@satoruhiga
satoruhiga / testApp.cpp
Created January 27, 2012 06:13
image from base64 string
#include "testApp.h"
#include "Poco/Base64Decoder.h"
// # encodeing
// $ base64 openFrameworks.png
string base64ImageData = "iVBORw0KGgoAAAANSUhEUgAAAHIAAAA8CAYAAAC6j+5hAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sLGgwmJX2ZbqEAAAQrSURBVHja7Z2rdxtHFIe/34xspFO+f4BbXIXrD6hQkIMC2qAE1CygMbJBjWpSFhGjmoTJxRUpqniPeMXbZfHOLdjNqRw/9Kj2odm9TEBndefbO/cxd65kZrRVJD2r4DF/mdlC0hHwRUnP+FtVg5TUB74qPv5pZmldIHtyv5f/FHt/azb28j8LG5TwgDTDXvdKBHYEDBwMwPU/KeHR54uZq4tmENIAM2BmZnM6WQuimc17u4Z3gBsFbORRf+mtXP1dbADCw7AAnBr6LRCuO6hPQwTYCcie9A3olUdJYGdbdV/5CzHqyS2KLeqm43cfIoD7v8FCT+4D6BRISvzhCei0J/dB0rCDeBfi1hYpKXFw4ql8UROPLrz8LBDOzWzRQdzSIiUNPboS9VmGsIFHVy2zzkchbgzyUP7Eowug3wDF+h5dHMqftB3iRiC9/LuAHTdNw4Ade/l3EZct5hn2fFXk7taFKGzUWFWxkZeu4oQYXq9TNHH7DvE/mDqKyzLXh7gSZE/6bh8gLltmHD5zM4hPgswLynq1b0sQsOP9jmY3h/goSEl9j37c16Xw6FRS0haIj4J0cNqQFGPr1MTBSVsgPghS0rM6k/0dBj/Dis4ba4f4IEgH38cS93n0Qxsg3gNZWONRRIlYkp/MxA3xHkiH+za2lNrgRewQ74CUlJTUilB7oaDoVogW4h2QB7hjIpUD3ChmiHdABizaI6Hm6FYORCgOliUlnn1MoNcPeiQldR5EizDJ
@signed0
signed0 / gist:2031157
Created March 13, 2012 19:53
Google Polyline encoder & decoder
'''Provides utility functions for encoding and decoding linestrings using the
Google encoded polyline algorithm.
'''
def encode_coords(coords):
'''Encodes a polyline using Google's polyline algorithm
See http://code.google.com/apis/maps/documentation/polylinealgorithm.html
for more information.
@companje
companje / testApp.cpp
Created May 21, 2012 17:57
Cube to Sphere Deformation
#include "testApp.h"
#define foreach(t,v) for(typeof(v.begin()) p=v.begin(); p!=v.end(); p++) { typeof(*p) &t=*p;
#define endfor }
class Vertex : public ofVec3f {
public:
Vertex(float x, float y) : ofVec3f(x,y) {}
Vertex(ofVec3f v) { set(v); }
ofFloatColor color;
git checkout develop
git log -1
git checkout translation
git cherry-pick [commit hash goes here]
@andreyvit
andreyvit / tmux.md
Created June 13, 2012 03:41
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a

@companje
companje / cloud-alpha-shader.cpp
Created July 19, 2012 18:26
Earth with Clouds AlphaBlending Shader
//testApp.cpp
#include "ofMain.h"
class testApp : public ofBaseApp {
public:
ofShader shader;
ofImage earth,clouds;
ofEasyCam cam;
GLUquadricObj *quadric; //for gluSphere
@companje
companje / subdivide-tetrahedron.cpp
Created August 4, 2012 16:21
Subdivide a tetrahedron to a sphere with ofMesh in openFrameworks
#include "ofMain.h"
#include "ofAppGlutWindow.h"
class ofApp : public ofBaseApp {
public:
ofMesh mesh;
ofEasyCam cam;
void setup() {
@ofZach
ofZach / gitignore OF
Created September 12, 2012 14:41
good gitignore for OF
# Some general ignore patterns
build/
obj/
*.o
Debug*/
Release*/
*.mode*
*.app/
*.pyc
.svn/
@jkosoy
jkosoy / .bash_profile
Last active October 13, 2015 02:38
Bash Profile Settings.
alias ls='ls -GFh'
export CLICOLOR=1
# From Andrzej Szelachowski's ~/.bash_profile:
# Note that a variable may require special treatment
#+ if it will be exported.
DARKGRAY='\[\e[1;30m\]'