Skip to content

Instantly share code, notes, and snippets.

View TrevorSayre's full-sized avatar

Trevor Sayre TrevorSayre

View GitHub Profile
@dergachev
dergachev / GIF-Screencast-OSX.md
Last active April 19, 2024 11:00
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@tbranyen
tbranyen / defines.js
Last active February 11, 2024 20:41
AMD Flavors.
// Anonymous empty module.
define();
// Anonymous values.
define({});
define(true);
define(1234);
define(null);
define(undefined);
@hageldave
hageldave / BarycentricGradientPaint.java
Last active January 3, 2022 14:57
A java.awt.Paint implementation for triangular color interpolation (using barycentric coordinates). The svg file shows the result of the demo app (embedded image).
/* Copyright 2021 David Haegele - Source from JPlotter */
import java.awt.Color;
import java.awt.Paint;
import java.awt.PaintContext;
import java.awt.Rectangle;
import java.awt.RenderingHints;
import java.awt.Shape;
import java.awt.geom.AffineTransform;
import java.awt.geom.Point2D;
@rhysforyou
rhysforyou / gist:4417106
Last active December 10, 2015 09:49 — forked from statico/gist:3172711
A step-by-step guide on using a PS3 controller with OS X

How to use a PS3 controller on Mac OS X 10.8 (Mountain Lion)

  1. Open Apple menu → System Preferences → Bluetooth and disable Bluetooth on Mac as well as any other nearby Macs or devices which will try to pair with and confuse the controller.

  2. Reset PS3 controller by inserting paperclip into pinhole near L2 button.

  3. Connect PS3 controller to Mac with USB cable.

  4. Enable Bluetooth.

@cowboy
cowboy / jQuery-deferreds-wtf-anger.js
Last active August 29, 2015 13:56
Man, jQuery Deferreds annoy the fuck out of me.
// When a jQuery deferred is resolved with a single value, the arguments to
// the .then callback are the same as when .then is called directly on the
// deferred or on $.when(deferred) AND ALSO $.when(deferred, deferred).
var dfd = $.Deferred().resolve([1, 2, 3]);
dfd.then(function(a) {
console.log('[1a]', a); // [1, 2, 3]
});
$.when(dfd).then(function(a) {
console.log('[2a]', a); // [1, 2, 3]
});