Skip to content

Instantly share code, notes, and snippets.

@sapphiriq
sapphiriq / README.md
Last active August 29, 2015 14:07
SublimeText Javascript/Coffeescript snippets for require

Autonaming variables

// req<TAB>
var webpackDevServer = require('webpack-dev-server');
var merge = require('react/lib/merge');
var Store = require('../stores/Store');
$ git clone https://gist.github.com/60a89f7197719888630d.git ~/Library/Application\ Support/Sublime\ Text\ 3/Packages/JSRequireSnippets
var Comments = Backbone.Collection.extend({
url: function() {
return this.baseUrl + '/comments';
},
initialize: function(bootstrapData, options) {
this.baseUrl = options.baseUrl;
}
}),
Posts = Backbone.Collection.extend({
@return1
return1 / trim_enabler.txt
Last active August 25, 2023 02:59
TRIM Enabler for OS X Yosemite 10.10.3
#
# UPDATE for 10.10.4+: please consider this patch obsolete, as apple provides a tool called "trimforce" to enable trim support for 3rd party SSDs
# just run "sudo trimforce enable" to activate the trim support from now on!
#
# Original version by Grant Parnell is offline (http://digitaldj.net/2011/07/21/trim-enabler-for-lion/)
# Update July 2014: no longer offline, see https://digitaldj.net/blog/2011/11/17/trim-enabler-for-os-x-lion-mountain-lion-mavericks/
#
# Looks for "Apple" string in HD kext, changes it to a wildcard match for anything
#
# Alternative to http://www.groths.org/trim-enabler-3-0-released/
@sapphiriq
sapphiriq / gist:3871020
Created October 11, 2012 08:37 — forked from paulirish/gist:839879
requestAnimFrame() shim.
// see http://paulirish.com/2011/requestanimationframe-for-smart-animating/
// shim layer with setTimeout fallback
window.requestAnimFrame = (function(){
return window.requestAnimationFrame ||
window.webkitRequestAnimationFrame ||
window.mozRequestAnimationFrame ||
window.oRequestAnimationFrame ||
window.msRequestAnimationFrame ||
@chrismatthieu
chrismatthieu / gist:964754
Created May 10, 2011 15:58
SIP Registrar with Tropo PSTN
// Run Redis - cd redis-2.2.4 and run src/redis-server
var sip = require('sip');
var sys = require('sys');
var redis = require('redis');
var tropoapi = require('tropo-webapi');
//Trim leading and trailing whitespace from string values.
function trim(str) {
return str.replace(/^\s+|\s+$/g, '');