Skip to content

Instantly share code, notes, and snippets.

@jonraasch
jonraasch / jQuery.support-transition.js
Created April 21, 2010 14:32
Extends the jQuery.support object to CSS3 transition
// jQuery.support.transition
// to verify that CSS3 transition is supported (or any of its browser-specific implementations)
$.support.transition = (function(){
var thisBody = document.body || document.documentElement,
thisStyle = thisBody.style,
support = thisStyle.transition !== undefined || thisStyle.WebkitTransition !== undefined || thisStyle.MozTransition !== undefined || thisStyle.MsTransition !== undefined || thisStyle.OTransition !== undefined;
return support;
})();
@mindplay-dk
mindplay-dk / Loader.js
Created December 1, 2010 22:25
Dynamic loader for JS and CSS resources
/*
Version: 1.1
Developer: Rasmus Schultz <http://mindplay.dk>
License: GPL v3 <http://www.gnu.org/licenses/gpl-3.0-standalone.html>
Gist: <https://gist.github.com/724347>
Removing this notice from the source code would be bad karma.
*/
@mindplay-dk
mindplay-dk / GDownload.php
Created January 3, 2012 16:02
File Downloader for Yii (PHP)
<?php
/**
* @author Rasmus Schultz
* @link http://mindplay.dk
* @copyright Copyright &copy; 2010 Rasmus Schultz
* @license http://www.gnu.org/licenses/lgpl-3.0.txt
*/
/**
* This class allows multi-threaded file downloads, and regular file downloads.
@scottburton11
scottburton11 / gist:3222152
Created August 1, 2012 00:58
Audio Compression for Voiceover

About compression

Audio compression is used to reduce the dynamic range of a recording. Dynamic range is the difference between the loudest and softest parts of an audio signal. It was originally used to guard against defects when cutting wax and vinyl phonograph records, but generally became useful as a way of increasing the loudness of an audio recording without achieving distortion.

The goal of most compression applications is to increase the amplitude of the softest parts of a recording, without increasing the amplitude of the loudest parts.

Compressor anatomy

Compressors generally all have the same conceptual parts. However, not all compressors present variable controls for all parts to the user. If you don't see all of your compressor's controls here, there's a chance it either has a fixed value (and no control), or is named something else:

@potch
potch / tinyAMD.js
Last active February 11, 2024 22:34
Proposal shim for a Minimal AMD system
// # tinyAMD: a Minimal AMD shim.
// I define Minimal AMD as the following:
// * Every define() call provides a module id field (no filename magic)
// * No additional network traffic to fetch modules
// * All dependencies must be defined before a module may be required
// ## Uses
// * small-footprint production shim for use with an r.js optimized project
// * If you write modules in Minimal AMD coding style, you can use tinyAMD
@mindplay-dk
mindplay-dk / TestServer.php
Last active November 20, 2019 12:23
Minimal (copy and paste) unit testing
<?php
/**
* This class will launch the built-in server in PHP 5.4+ in the background
* and clean it up after use.
*/
class TestServer
{
/**
* @var resource PHP server process handle
@mindplay-dk
mindplay-dk / events.ts
Last active December 23, 2015 16:59
Simple event hook in TypeScript
var template_escape = {"\\": "\\\\", "\n": "\\n", "\r": "\\r", "'": "\\'"}
var render_escape = {'&': '&amp;', '"': '&quot;', '<': '&lt;', '>': '&gt;'}
function escape_fn(data) {
return (data || data === 0)
? (data + '').replace(/[&\"<>]/g, (e) => render_escape[e])
: ''
}
@mindplay-dk
mindplay-dk / example.css
Last active February 15, 2016 08:32
Simplified semantic grid calculation for SASS (based on http://semantic.gs/)
#layout {
display: block;
width: 940px; }
#left {
display: inline;
float: left;
width: 60px; }
#content {
@mindplay-dk
mindplay-dk / upgrade.php
Last active December 25, 2015 02:29
Simple (forward migration) command-line SQL script runner for MySQL.
<?php
/**
* Simple (forward migration) command-line SQL script runner for MySQL.
*
* To initialize the ".upgrade" file:
*
* php upgrade.php --init
*
* To flag all SQL files as applied (in the status file) without actually doing any work:
@mindplay-dk
mindplay-dk / example.css
Last active December 25, 2015 05:09
jQuery slideshow plugin (responsive version with CSS3 optimized animation)
/* main container: */
#test {
clear: both;
width: 100%;
min-width: 240px;
max-width: 790px;
height: 320px;
overflow: hidden;
font-family: Verdana, Arial;