Skip to content

Instantly share code, notes, and snippets.

View roboshoes's full-sized avatar

Mathias Paumgarten roboshoes

View GitHub Profile
@twe4ked
twe4ked / factorial.py
Created September 26, 2012 06:43 — forked from ghoseb/factorial.py
The evolution of a Python Programmer
View factorial.py
#Newbie programmer
def factorial(x):
if x == 0:
return 1
else:
return x * factorial(x - 1)
print factorial(6)
#First year programmer, studied Pascal
View watch-property.js
/**
* create a function that will return true once any time the value changes
* @param {Object} object
* @param {String} key
*/
function watchProperty(object, key){
var value = object[key];
return function(){
@millermedeiros
millermedeiros / example.html
Created August 28, 2012 13:52
node.js script to inline static includes
View example.html
<!DOCTYPE html>
<!-- #include "inc_header.html" title="Example" header="Sample Title" -->
<html>
<head>
<meta charset="utf-8">
<title>Example</title>
<link rel="stylesheet" href="css/main.css">
</head>
<body>
<h1>Sample Title</h1>
@hapticdata
hapticdata / unique-colors.js
Last active March 18, 2016 21:33
extract the unique colors out of an image
View unique-colors.js
module.exports = uniqueColors;
var _canvas;
/**
* Collect all of the unique colors within an image,
* all pixel values are returned as [ red, green, blue, alpha ] between 0 - 255
* @param {Image|HTMLCanvasElement} image
* @param {Number} [x] to start sampling
* @param {Number} [y] to start sampling
@mattdesl
mattdesl / frag.vert
Created May 17, 2016 21:25
shadow on transparent plane ThreeJS r76
View frag.vert
uniform vec3 diffuse;
uniform vec3 emissive;
uniform float opacity;
varying vec3 vLightFront;
#ifdef DOUBLE_SIDED
varying vec3 vLightBack;
@webdesserts
webdesserts / Gulpfile.js
Last active April 3, 2023 08:16
Automatically reload your node.js app on file change with Gulp (https://github.com/wearefractal/gulp).
View Gulpfile.js
// NOTE: I previously suggested doing this through Grunt, but had plenty of problems with
// my set up. Grunt did some weird things with scope, and I ended up using nodemon. This
// setup is now using Gulp. It works exactly how I expect it to and is WAY more concise.
var gulp = require('gulp'),
spawn = require('child_process').spawn,
node;
/**
* $ gulp server
* description: launch the server. If there's a server already running, kill it.
@patriciogonzalezvivo
patriciogonzalezvivo / GLSL-Noise.md
Last active February 21, 2024 11:27
GLSL Noise Algorithms
View GLSL-Noise.md

Please consider using http://lygia.xyz instead of copy/pasting this functions. It expand suport for voronoi, voronoise, fbm, noise, worley, noise, derivatives and much more, through simple file dependencies. Take a look to https://github.com/patriciogonzalezvivo/lygia/tree/main/generative

Generic 1,2,3 Noise

float rand(float n){return fract(sin(n) * 43758.5453123);}

float noise(float p){
	float fl = floor(p);
  float fc = fract(p);