Skip to content

Instantly share code, notes, and snippets.

View johnhunter's full-sized avatar
🌊
Working on net-zero energy

John Hunter johnhunter

🌊
Working on net-zero energy
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.
*/
@remy
remy / gist:349069
Created March 30, 2010 12:46
Early version of XUI native animations with drop back on to Emile/timer based
(function ($, window, undefined) {
var m = document.createElement('i'),
m_style = m.style,
// TODO support other browsers easings - based on Safari's easing options and ported to Emile easing.
stanardEasing = {
'ease-in-out' : function(pos){if((pos/=0.5)<1){return 0.5*Math.pow(pos,4);}return -0.5*((pos-=2)*Math.pow(pos,3)-2);},
'ease-in' : function(pos){return Math.pow(pos,4);},
'ease-out' : function(pos){return Math.pow(pos,0.25);},
'linear': function (i) {return i;}
@aza
aza / CSS Animation for jQuery.js
Created June 11, 2010 21:08
jQuery CSS Animation Extension
/* Copyright (c) 2011 Aza Raskin
|
| Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
| documentation files (the "Software"), to deal in the Software without restriction, including
| without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
| copies of the Software, and to permit persons to whom the Software is furnished to do so, subject
| to the following conditions:
|
| The above copyright notice and this permission notice shall be included in all copies or substantial portions
| of the Software.
@joelnet
joelnet / example.html
Created June 3, 2011 18:03
Unobtrusive Knockout support library for jQuery
Choose a ticket class: <select id="tickets"></select>
<p id="ticketOutput"></p>
<script id="ticketTemplate" type="text/x-jquery-tmpl">
{{if chosenTicket}}
You have chosen <b>${ chosenTicket().name }</b>
($${ chosenTicket().price })
<button data-bind="click: resetTicket">Clear</button>
{{/if}}
@scottmessinger
scottmessinger / backbone-todos.js
Created June 19, 2011 00:09
Backbone.js todos vs knockout.js todos
We couldn’t find that file to show.
@forxina
forxina / gist:1232482
Created September 21, 2011 16:05 — forked from tmc/gist:828553
fixed up backbone example to work with Backbone.js 0.5.3
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Backbone example</title>
<script type="text/javascript" src="jquery.min.js"></script>
<script type="text/javascript" src="underscore.js"></script>
<script type="text/javascript" src="backbone.js"></script>
@paulmelnikow
paulmelnikow / shadows.scss
Last active August 22, 2022 15:35
Sass Mixin: Google Material Design Shadow
/**
* A mixin which helps you to add depth to elements according to the Google Material Design spec:
* http://www.google.com/design/spec/layout/layout-principles.html#layout-principles-dimensionality
*
* Please note that the values given in the specification cannot be used as is. To create the same visual experience
* the blur parameter has to be doubled.
*
* Adapted from a LESS version at https://medium.com/@Florian/freebie-google-material-design-shadow-helper-2a0501295a2d
*
* Original Author: Florian Kutschera (@gefangenimnetz), Conceptboard GmbH (@conceptboardapp)