Skip to content

Instantly share code, notes, and snippets.

int[][] result;
float t, c;
public float ease(float p) {
return 3*p*p - 2*p*p*p;
}
public float ease(float p, float g) {
if (p < 0.5f)
return 0.5f * pow(2*p, g);
// note : if you're on github gist and want to copy paste this code, you can click on the "Raw" button
// and then do Ctrl A, Ctrl C, Ctrl V
// (code below by Kurt Spencer, slightly modified code to run as Processing tab)
// maybe you should rather use this new (improved) version of the noise instead : https://github.com/KdotJPG/OpenSimplex2
/*
* OpenSimplex Noise in Java.
* by Kurt Spencer
*
* v1.1 (October 5, 2014)
@tsulej
tsulej / object_mccc_sep16.pde
Created September 13, 2016 13:49
The Object MCCC Sep 16
// The Object
//
// GenerateMe submission to MCCC Sep 2016
// generateme.blog@gmail.com
// http://generateme.tumblr.com/
// http://folds2d.tumblr.com/
void setup() {
size(540, 540);
PShape sierp, lightShape;
Col[] cols;
float cubeRot, cubeSize;
float isoAngle;
int lights;
LightInfo[] lightlist;
public void setup() {
size(500, 500, P3D);
@mnpenner
mnpenner / color.js
Last active July 9, 2016 15:01
RGB <-> HSL+HSL, for Node.js
/**
* Converts an RGB color value to HSL. Conversion formula
* adapted from http://en.wikipedia.org/wiki/HSL_color_space.
* Assumes r, g, and b are contained in the set [0, 255] and
* returns h, s, and l in the set [0, 1].
*
* @param {number} r The red color value
* @param {number} g The green color value
* @param {number} b The blue color value
* @return {array} The HSL representation
@ketankhairnar
ketankhairnar / DecoratorTraits.scala
Created February 27, 2011 06:48
Decorator pattern using scala traits
package com.example.chapter7.traits
class DecoratorTraits
abstract class Check {
def check():String ="Checked application details"
}
trait employmentCheck extends Check {
override def check():String="Checked employment details " +super.check()