Skip to content

Instantly share code, notes, and snippets.

@zz85
zz85 / gist:1395215
Created November 26, 2011 07:13
Testing Creation of Simplex Noise Textures
function createNoiseTexture(width, height) {
var canvas = document.createElement("canvas");
canvas.width = width;
canvas.height = height;
var context = canvas.getContext('2d');
var image = context.createImageData( width, height );
var imageData = image.data;
@gre
gre / easing.js
Last active April 13, 2025 15:13
Simple Easing Functions in Javascript - see https://github.com/gre/bezier-easing
/*
* This work is free. You can redistribute it and/or modify it under the
* terms of the Do What The Fuck You Want To Public License, Version 2,
* as published by Sam Hocevar. See the COPYING file for more details.
*/
/*
* Easing Functions - inspired from http://gizma.com/easing/
* only considering the t value for the range [0, 1] => [0, 1]
*/
EasingFunctions = {
@zz85
zz85 / fraction.js
Created April 12, 2012 18:55
Fractional / Rational Number Class for performing fractional calculations
// fraction / rational number class
// @author zz85
Vex.Flow.Fraction = function(numerator, denominator) {
this.set(numerator, denominator);
};
Vex.Flow.Fraction.prototype.constructor = Vex.Flow.Fraction;
Vex.Flow.Fraction.prototype.set = function(numerator, denominator) {
this.numerator = numerator === undefined ? 1 : numerator;
@Mparaiso
Mparaiso / main.js
Created July 24, 2012 12:15
three.js, TweenLite , Coordinates.js
var camera,
scene,
renderer,
group,
grid,
wave ,
mesh,
currentLayout,
container,
layoutNames,
@zz85
zz85 / ShaderUtils.js
Last active July 26, 2022 20:02
AutoGen Three.js Shader Uniforms
// https://github.com/mrdoob/three.js/issues/4145
// based on https://github.com/unconed/ShaderGraph.js/blob/master/src/Snippet.js
var typeMaps = {
'float': 'f',
'vec2': 'v2',
'vec3': 'v3',
'vec4': 'v4',
'mat3': 'm3',
'mat4': 'm4',
@dmann99
dmann99 / _.md
Created April 19, 2014 20:12
Pop-Up Schemio 3d
<div id="bored" class="step slide" data-x="-1000" data-y="-1500">
<q>Aren't you just <b>bored</b> with all those slides-based presentations?</q>
</div>
<div class="step slide" data-x="0" data-y="-1500">
<q>Don't you think that presentations given <strong>in modern browsers</strong> shouldn't <strong>copy the limits</strong> of 'classic' slide decks?</q>
</div>
<div class="step slide" data-x="1000" data-y="-1500">
<q>Would you like to <strong>impress your audience</strong> with <strong>stunning visualization</strong> of your talk?</q>
</div>
@jcleblanc
jcleblanc / subscription_billing.js
Created June 26, 2014 05:58
paypal_rest_subscriptions_billing_agreement
curl -v POST https://api.sandbox.paypal.com/v1/payments/billing-plans \
-H 'Content-Type:application/json' \
-H 'Authorization: Bearer {accessToken}' \
-d '{
"name": "Fruit of the Month",
"description": "10 Pound Box of Fruit",
"type": "fixed",
"payment_definitions": [
{
"name": "Standard Package",
@goooooouwa
goooooouwa / daily-bash-script-samples.sh
Last active August 25, 2023 06:21
daily bash script samples
#!/bin/bash
# For loop to exeute some task multiple times
for i in Item1 Item2 ItemN; do
bash ~/task.sh ${i}
done
for i in {1..10}
do
wget https://static.generated.photos/vue-static/human-generator/poses/female/00$i.png
@heitortsergent
heitortsergent / app.js1
Last active July 19, 2022 09:23
Email-confirmation Email Tutorial
app.post('/login', function(req,res) {
console.log('user email: ', req.body.email);
res.render('index', {title: 'Sent authentication email'});
});
app.get('/verify_email', function(req,res) {
console.log('verify_email token: ',req.query.token);
res.render('index', {title: 'Authenticating...'});