Skip to content

Instantly share code, notes, and snippets.

View seutje's full-sized avatar

Steve De Jonghe seutje

View GitHub Profile
@seutje
seutje / wobbles.js
Last active August 29, 2015 14:04
wobbles for wavepot
/*!
*
* stagas - mind swift (seutje wobble mix)
*
*/
var bpm = 130;
var tuning = 440;
var transpose = 11;
var hardcodedTimer = 7.4;
@seutje
seutje / longline.js
Created July 24, 2014 09:36
Long line theory
/*!
*
* Welcome to Long Line Theory
* ------------------
*
* A start of a human readable port of a well done bytebeat findable here : http://www.pouet.net/topic.php?which=8357&page=13
* Made readable by @Eiyeron
* Enjoy!
*
*/
@seutje
seutje / mindswift-remix.js
Last active August 29, 2015 14:03
wavepot mind swift fork
/*!
*
* stagas - mind swift
*
*/
var bpm = 130;
var tuning = 440;
var transpose = 11;
@seutje
seutje / getFontSize.js
Created July 2, 2014 10:00
log all parents and their computed font size
// Select an element in the inspector and run this in the console
function foo(node) {
if (window.getComputedStyle(node)) {
console.log(node, window.getComputedStyle(node).fontSize);
} else {
console.log(node, 'no size');
}
if (node.parentNode) {
foo(node.parentNode);
}
@seutje
seutje / old_cycle_invisible_parent.js
Created June 6, 2014 12:24
Monkey patch old cycle to make sure it's in a visible parent.
;(function($) {
// Intentionally not using strict mode so we can use arguments
// Store scoped reference to the old method.
var _cycle = $.fn.cycle;
// Craft our own.
$.fn.cycle = function() {
// Find the closest visible parent.
var visibleParent = this.closest(':visible');
// Make its children visible.
@seutje
seutje / gremlins.js minified bookmarklet
Created March 14, 2014 15:09
gremlins.js bookmarklet
(function (e, a, h, f, c, b, d) {
c = a.createElement("script");
c.type = "text/javascript";
c.src = "https://rawgithub.com/marmelab/gremlins.js/master/gremlins.min.js";
c.onload = c.onreadystatechange = function () {
if (!b && (!(d = this.readyState) || d == "loaded" || d == "complete")) {
h();
f(c).remove()
}
};
@seutje
seutje / SassMeister-input-HTML.html
Created February 21, 2014 12:31
Generated by SassMeister.com.
<div class="wrap">
<div class="col"></div><div class="col"></div><div class="col"></div>
<div class="col"></div><div class="col"></div><div class="col"></div>
<div class="col"></div><div class="col"></div><div class="col"></div>
<div class="col"></div><div class="col"></div><div class="col"></div>
</div>
$.fn.equalizeRows = function() {
var currentTallest = 0,
currentRowStart = 0,
rowDivs = [],
$el,
topPos = 0,
currentDiv;
return this.each(function() {
@seutje
seutje / SassMeister-input-HTML.html
Created January 21, 2014 11:19
Generated by SassMeister.com.
<a href="#" class="button">Click me</a>
@seutje
seutje / parrallel-fetching.js
Created January 3, 2014 12:55
Using jQuery's Deferred objects to cache a ton of assets in parallel and execute a callback after they're all done.
Foo.prototype.setupAssets = function() {
this.assets = this.assets || {};
var calls = $.map(this.opts.assets, $.proxy(this.fetchAsset, this));
$.when.apply(this, calls).then($.proxy(this.intro, this)); // Fetch all assets in parallel and call intro after they're all done.
};
Foo.prototype.fetchAsset = function(url, label) {
if (typeof url === 'string') {
// return ajax call deferred object.
return $.ajax({