Skip to content

Instantly share code, notes, and snippets.

View eskimoblood's full-sized avatar
🙀
snafu

Andreas Köberle eskimoblood

🙀
snafu
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.
*/
!function() {
var doc = document,
htm = doc.documentElement,
lct = null, // last click target
nearest = function(elm, tag) {
while (elm && elm.nodeName != tag) {
elm = elm.parentNode;
}
return elm;
};
dojo.provide("dojox.mustache._Templated");
dojo.require("dijit._Widget");
dojo.require("dijit._Templated");
//
// INSTALL: copy http://github.com/janl/mustache.js to this folder as _base.js
// Add dojox.mustache = dojo.hitch(Mustache, "to_html") in _base.js, wrapping
// the whole file in a self-executing-anonymous-function. eg:
//
// dojo.provide("dojox.mustache._base");
// (function(){
build:
@echo "Combining files ..."
@cat \
js/dep/jquery.easing.js \
js/dep/jquery.jsonp.js \
js/dep/json2.js \
js/dep/toolbox.expose.js \
js/lib/jquery.transloadit2.js > build/jquery.transloadit2.js
@echo "Compiling with Closure REST API ..."
@curl \
@nzakas
nzakas / sprintf.js
Created June 8, 2011 02:56
Quick and dirty sprintf
/*
* Quick and Dirty sprintf
* Copyright 2011 Nicholas C. Zakas. All rights reserved.
* BSD licensed
*/
/*
* This function does not attempt to implement all of sprintf, just %s,
* which is the only one that I ever use.
*/
@karlwestin
karlwestin / test.js
Created December 12, 2013 11:05
Nice javascript unit testing (jasmine) trick: which spec takes the most time?
describe("test suite that you wanna perf", function() {
beforeEach(function() {
this.start = performance.now();
});
afterEach(function() {
console.log(jasmine.getEnv().currentSpec.description, performance.now() - this.start);
});
});
@ryanflorence
ryanflorence / Dialog.js
Last active January 9, 2021 16:12
React Portal.js
var Dialog = React.createClass({
mixins: [Portal],
createPortal: function() {
this.dialog = $(this.portalNode).dialog({
autoOpen: false,
title: this.props.title,
close: this.props.onClose
}).data('ui-dialog');
},
@tkafka
tkafka / LICENSE.txt
Last active September 5, 2019 13:38
Drop-in replacement for ReactCSSTransitionGroup that uses velocity.js instead of CSS transforms. Add your own transitions to `transitions` hash.
The MIT License (MIT)
Copyright (c) 2014 Tomas Kafka
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:
.
├── actions
├── stores
├── views
│   ├── Anonymous
│   │   ├── __tests__
│   │   ├── views
│   │   │   ├── Home
│   │   │   │   ├── __tests__
│   │   │   │   └── Handler.js
@fson
fson / rapid-prototyping-with-relay.md
Created October 18, 2015 20:08
Rapid prototyping with Relay (Reactive 2015 lightning talk proposal)

This is a proposal for a lightning talk at the Reactive 2015 conference.

NOTE: If you like this, star ⭐ the Gist - the amount of stars decides whether it makes the cut!

Rapid prototyping with Relay

Relay makes data fetching in React apps simpler, by letting you declare the data needs of your components instead of writing complex imperative code. React, Relay, GraphQL and the other complementary tools are changing how apps are built.