Skip to content

Instantly share code, notes, and snippets.

@builtbylane
builtbylane / log all jQuery events
Last active September 20, 2017 17:15 — forked from kirkonrails/log all jQuery events
Log all jQuery events to console via redfine jquery trigger
const oldJQueryEventTrigger = jQuery.event.trigger;
jQuery.event.trigger = ( event, data, elem, onlyHandlers ) => {
console.log( event, data, elem, onlyHandlers );
oldJQueryEventTrigger( event, data, elem, onlyHandlers );
};
cd /usr/local/Library/Formula
brew remove node --force
brew versions node
git checkout 83988e4 /usr/local/Library/Formula/node.rb
brew install node
_.mixin({
serialize: function (obj) {
var urlParams = _.map(obj, function (val, key) {
var value = (_.isObject(val)) ? JSON.stringify(val) : String(val);
return String(key) + '=' + value;
});
return urlParams.join('&');
}
});
/**
* Converts an image to
* a base64 string.
*
* If you want to use the
* outputFormat or quality param
* I strongly recommend you read the docs
* @ mozilla for `canvas.toDataURL()`
*
* @param {String} url
@builtbylane
builtbylane / 0_reuse_code.js
Created June 9, 2014 16:55
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@mixin arrow_helper($arrowSize, $arrowColor, $margin, $side, $align) {
@if $side == "top" {
border-bottom-color: $arrowColor;
top: -2 * $arrowSize;
}
@if $side == "bottom" {
border-top-color: $arrowColor;
bottom: -2 * $arrowSize;
}
@if $side == "left" {

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt