Skip to content

Instantly share code, notes, and snippets.

@imcodetolive
imcodetolive / gist:3057264
Created July 6, 2012 00:15 — forked from lucasfais/gist:1207002
Sublime Text 2 - Useful Shortcuts

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
@imcodetolive
imcodetolive / launch_sublime_from_terminal.markdown
Created October 9, 2012 00:36 — forked from olivierlacan/launch_sublime_from_terminal.markdown
Launch Sublime Text 2 from the Mac OS X Terminal

Launch Sublime Text 2 from the Mac OS X Terminal

Sublime Text 2 ships with a CLI called subl (why not "sublime", go figure). This utility is hidden in the following folder (assuming you installed Sublime in /Applications like normal folk. If this following line opens Sublime Text for you, then bingo, you're ready.

open /Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl

You can find more (official) details about subl here: http://www.sublimetext.com/docs/2/osx_command_line.html

Installation

// Use before yours CSS files
document.documentElement.className = document.documentElement.className.replace(/(\s*|^)no-js(\s*|$)/, "$1js$2");
/**
* Placeholder
* @author Diego Oliveira <[email protected]>
*/
;(function(){
var _private = {},
methods = {};
_private = {
onblur : function(force){
@imcodetolive
imcodetolive / parseURLParams.js
Created September 4, 2014 17:45
Convert URL parameters to a javascript object
define(function(){
"use strict";
var parseURLParams;
parseURLParams = function(str){
var obj;
obj = {};
@imcodetolive
imcodetolive / constrain.js
Created September 4, 2014 18:14
Constrain a number between two bounds
define(function(){
"use strict";
var constrain;
constrain = function(min, max){
return function(number){
return Math.max(min, Math.min(number, max));
};
};
function modify(modifiers) {
return through2.obj(function(file, encoding, done) {
var stream = this;
function applyModifiers(content) {
(typeof modifiers === 'function' ? [modifiers] : modifiers).forEach(function(modifier) {
content = modifier(content, file);
});
// Create a global Event Bus
var EventBus = new Vue()
// Add to Vue properties by exposing a getter for $bus
Object.defineProperties(Vue.prototype, {
$bus: {
get: function () {
return EventBus;
}
}
@imcodetolive
imcodetolive / LICENSE.txt
Created October 3, 2017 17:42 — forked from jed/LICENSE.txt
use anchor tags to parse URLs into components
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Jed Schmidt <http://jed.is>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE