Skip to content

Instantly share code, notes, and snippets.

View pifantastic's full-sized avatar

Aaron Forsander pifantastic

  • Stripe
  • Austin, TX
View GitHub Profile
define(['./rison', './util'], function(rison, util) {
function Tracker(config) {
// Copy over the default settings.
this.settings = util.extend({}, this._defaults, config);
}
return Tracker;
}
@pifantastic
pifantastic / jquery.keyhold.js
Created January 4, 2012 00:19
jQuery keyhold plugin. Records the number of milliseconds a key is pressed.
(function($) {
var k = {};
$(window).bind('keydown', function(e) {
if (!k[e.which]) {
k[e.which] = +new Date;
}
});
[
{
"id": "Botaurus stellaris",
"label": "Great Bittern",
"value": "Great Bittern"
},
{
"id": "Ixobrychus minutus",
"label": "Little Bittern",
"value": "Little Bittern"
$('fieldset').each(function(i){
if (i == 0){
someFunction();
}
});
* jQuery UI Tabs 1.8.16
*
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Tabs#theming
*/
.ui-tabs { position: relative; padding: .2em; zoom: 1; } /* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */
.ui-tabs .ui-tabs-nav { margin: 0; padding: .2em .2em 0; }
$(".add_comment_link").click(function() {
$(this).next(".add_comment").slideToggle();
});
var api = new SnipAPI({ version: 'v1', key: '123' });
api.find('appointment', 1, function(error, appointment) {
console.log(error || appointment);
});
api.find('appointment', { start_time__gte: new Date }, function(error, appointments) {
if (error) {
console.error(error.messages.join('\n'));
}
$ curl "http://api.sniphq.com/api/v1/appointment.json?key=123"
{
"data": [
{
"pk": 1,
"model": "appointments.appointment",
"fields": {
"stylist": {
"salon": 1,
{
"color_scheme": "Packages/Color Scheme - Default/Tomorrow-Night.tmTheme",
"font_face": "Bitstream Vera Sans Mono",
"font_size": 15,
"tab_size": 2,
"translate_tabs_to_spaces": true,
"trim_trailing_white_space_on_save": true
}
beard()
.get('http://google.com/secrets/algorithms/search.txt')
.done(function(algorithm) {
// omg hax
})
.fail(function(error) {
console.log('There was an error!', error)
})