This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Launch SublimeText2 from the Terminal (on MacOS X) ## | |
1/ Open Terminal.app | |
2/ Copy/paste the following symbolic link. You can replace 'subl' at the end with the keyword of your choice | |
ln -s "/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl" /usr/local/bin/subl | |
3/ Now you can open files and projects directly from the Terminal | |
- Open the current folder as a project: "subl ." | |
- Open a file "subl _PATH_/file.js" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// http://paulirish.com/2011/requestanimationframe-for-smart-animating/ | |
// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating | |
// requestAnimationFrame polyfill by Erik Möller | |
// fixes from Paul Irish and Tino Zijdel | |
(function() { | |
var lastTime = 0; | |
var vendors = ['ms', 'moz', 'webkit', 'o']; | |
for(var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
// If true, when the file is saved any errors will appear in a popup list | |
"sublimelinter_popup_errors_on_save": false, | |
// Javascript linter: "gjslint" to use the closure javascript linter (if available), | |
// or either "jshint" or "jslint" to use a built in linter. | |
"javascript_linter": "jshint", | |
// jshint: options for linting JavaScript. See http://www.jshint.com/options/ for more info. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
(function(w, d, s) { | |
function go(){ | |
var js, fjs = d.getElementsByTagName(s)[0], load = function(url, id) { | |
if (d.getElementById(id)) {return;} | |
js = d.createElement(s); js.src = url; js.id = id; | |
fjs.parentNode.insertBefore(js, fjs); | |
}; | |
load('//connect.facebook.net/en_US/all.js#appId=272697932759946&xfbml=1', 'fbjssdk'); | |
load('https://apis.google.com/js/plusone.js', 'gplus1js'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Textfill Module | |
// ---------------- | |
// auto font rezize based on the parent size | |
// | |
(function($, window) { | |
var initialFontSize = null; | |
$.fn.textfill = function(maxFontSize) | |
{ | |
maxFontSize = parseInt(maxFontSize, 10); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
window.log = function () { | |
log.history = log.history || []; | |
log.history.push(new Date(), arguments); | |
if (this.console) { | |
arguments.callee = arguments.callee.caller; | |
var a = [].slice.call(arguments); | |
(typeof console.log === "object" ? log.apply.call(console.log, console, a) : console.log.apply(console, a)) | |
} | |
log.displayHistory = function() { | |
for (var i=0, len=window.log.history.length; i<len; i++) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Skeleton jQuery plugin | |
function($) | |
{ | |
$.fn.myPlugin = function( options ) | |
{ | |
// options. | |
$.fn.myPlugin.settings = $.extend( {}, $.fn.myPlugin.defaults, options ); | |
// Go through the matched elements and return the jQuery object. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
A (very) WIP collection of optimized/recommended jQuery plugin patterns | |
from @addyosmani, @cowboy, @ajpiano and others. | |
Disclaimer: | |
----------------------- | |
Whilst the end-goal of this gist is to provide a list of recommended patterns, this | |
is still very much a work-in-progress. I am not advocating the use of anything here | |
until we've had sufficient time to tweak and weed out what the most useful patterns |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var $touchArea = $('#touchArea'), | |
touchStarted = false, // detect if a touch event is sarted | |
currX = 0, | |
currY = 0, | |
cachedX = 0, | |
cachedY = 0; | |
//setting the events listeners | |
$touchArea.on('touchstart mousedown',function (e){ | |
e.preventDefault(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Open terminal and type | |
defaults write com.google.Chrome.plist AppleEnableSwipeNavigateWithScrolls -bool FALSE | |
# For mavericks | |
defaults write com.google.Chrome AppleEnableSwipeNavigateWithScrolls -bool FALSE |
OlderNewer