Skip to content

Instantly share code, notes, and snippets.

View darkwing's full-sized avatar

David Walsh darkwing

View GitHub Profile
/*
Script: Color.js
Class for creating and manipulating colors in JavaScript. Includes basic color manipulations and HSB <-> RGB <-> HEX Conversions.
License:
MIT-style license.
*/
function Color(params){
var ptype = $type(params);
/* digitarald's, before */
for (var i = 0, selector; (selector = parsed[i]); i++) {
var locate = locateCurrent;
if (selector.first) {
if (!results) locate = locateFast;
if (iterate) nodes = context;
else if (selector.combinator) nodes = [context]; // allows combinators before selectors
['get', 'post', 'put', 'delete'].each(function(method){
methods[method] = methods[method.toUpperCase()] = function(){
var params = Array.link(arguments, {url: String.type, data: $defined});
return this.send($extend(params, {method: method}));
};
});
var Templatizer = new Class({
Implements: [Options, Events],
options: {
templates: {
/*
name: instanceOfSubtleTemplate
*/
},
data: {}
},
<div id="fellows" data-url="/fellows">
<!-- list of fellows -->
</div>
var MyClass = new Class({
options: {
option1: 1,
option2: 2
},
Implements: [Options,Events],
Requires: [DependencyClass1,DependencyClass2],
var cycles = 0;
var loaded = true;
var minTime = 15000;
var int = 50
var loaded = false;
$(window).load(function() {
loaded = true;
});
@darkwing
darkwing / gist:2838005
Created May 30, 2012 18:06
Zamboni + Vagrant Updater
#!/bin/sh
# The purpose of this file is to document the process of upgrading a vagrant
# machine for zamboni, since the VM defaults seem well out of date
# Run the post-install
chmod +x postinstall.sh
sudo ./postinstall.sh
# Create a temp folder for downloads
info: Service pid 6681 initializing
info: Service pid 6684 initializing
info: Starting up service on port 9080
info: Service pid 6686 initializing
info: Starting up service on port 9080
info: Service pid 6689 initializing
info: Starting up service on port 9080
info: Service pid 6688 initializing
info: Starting up service on port 9080
[12/Jun/2012 07:36:38] "GET /fr/__debug__/m/js/toolbar.min.js HTTP/1.1" 304 0 (time: 0.63s; sql: 0ms (0q))
[profile] Total time to render was 0.00s
[12/Jun/2012 07:36:38] "GET /en-US/jsi18n/build:dev HTTP/1.1" 200 1761 (time: 0.52s; sql: 0ms (0q))
[12/Jun/2012 07:36:40] "GET /docs/ckeditor_config.js?t=B8DJ5M3 HTTP/1.1" 301 0 (time: 0.09s; sql: 0ms (0q))
[12/Jun/2012 07:36:40] "GET /__debug__/m/css/toolbar.min.css HTTP/1.0" 301 0 (time: 0.10s; sql: 0ms (0q))
[profile] Total time to render was 0.01s
[12/Jun/2012 07:36:40] "GET /fr/__debug__/m/css/toolbar.min.css HTTP/1.1" 304 0 (time: 0.62s; sql: 0ms (0q))
[profile] Total time to render was 0.05s
[12/Jun/2012 07:36:41] "GET /fr/docs/ckeditor_config.js?t=B8DJ5M3 HTTP/1.1" 200 2118 (time: 0.71s; sql: 0ms (1q))
[profile] Total time to render was 0.01s