⌘T | go to file |
⌘⌃P | go to project |
⌘R | go to methods |
⌃G | go to line |
⌘KB | toggle side bar |
⌘⇧P | command prompt |
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
// Decay class, to call a callback less and less often. For example, | |
// make an Ajax request and freshen the decay only if the request has changed. | |
// | |
// To start the timeouts, call decay_object.start() | |
// To freshen up the speed of query, call decay_object.reset() | |
// | |
// Options: | |
// - seconds: time between each callback at the start and after a reset() (default 2) | |
// - decay: multiplier to use after each callback call (default 1.3) | |
// - max: maximum number of seconds to wait between each call (default 42) |
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
// JS Module Pattern: | |
// http://j.mp/module-pattern | |
// Redefine: $, window, document, undefined. | |
var APP = (function($, window, document, undefined) { | |
// Automatically calls all functions in APP.init | |
$(document).ready(function() { | |
APP.go(); | |
}); |
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 short snippet for detecting versions of IE in JavaScript | |
// without resorting to user-agent sniffing | |
// ---------------------------------------------------------- | |
// If you're not in IE (or IE version is less than 5) then: | |
// ie === undefined | |
// If you're in IE (>=5) then you can determine which version: | |
// ie === 7; // IE7 | |
// Thus, to detect IE: | |
// if (ie) {} |
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 short snippet for detecting versions of IE in JavaScript | |
// without resorting to user-agent sniffing | |
// ---------------------------------------------------------- | |
// If you're not in IE (or IE version is less than 6) then: | |
// ie === 0 | |
// If you're in IE (>=6) then you can determine which version: | |
// ie === 7; // IE7 | |
// Thus, to detect IE: | |
// if (ie) {} |
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
<?php | |
/* | |
Plugin Name: Videos | |
Plugin URI: | |
Author: Dave Rupert | |
Author URI: http://www.daverupert.com | |
Description: A custom post type that adds videos and custom taxonomies. | |
Version: 1.0 | |
*/ |
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
require 'rubygems' | |
require 'middleman' | |
middleman_app = Middleman::Server.new | |
protected_middleman = Rack::Auth::Basic.new(middleman_app) do |username, password| | |
[username, password] == ['theuser', 'thepassword'] | |
end | |
run protected_middleman |
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
$linear: cubic-bezier(0.250, 0.250, 0.750, 0.750) !default; | |
$ease: cubic-bezier(0.250, 0.100, 0.250, 1.000) !default; | |
$ease-in: cubic-bezier(0.420, 0.000, 1.000, 1.000) !default; | |
$ease-out: cubic-bezier(0.000, 0.000, 0.580, 1.000) !default; | |
$ease-in-out: cubic-bezier(0.420, 0.000, 0.580, 1.000) !default; | |
$ease-in-quad: cubic-bezier(0.550, 0.085, 0.680, 0.530) !default; | |
$ease-out-quad: cubic-bezier(0.250, 0.460, 0.450, 0.940) !default; | |
$ease-in-out-quad: cubic-bezier(0.455, 0.030, 0.515, 0.955) !default; |
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
/* function to urlify a string */ | |
var urlify = function(a){return a.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "-").replace(/^-+|-+$/g, '')}; | |
/* usage example */ | |
var str_a = "* The Best Wallpaper Magazine in the . ? & world! : Rjer9238131 & "; | |
urlify(str_a) | |
/* returns */ | |
"the-best-wallpaper-magazine-in-the-world-rjer9238131" |
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
local user_host='%{$fg[green]%}%n@%m%{$reset_color%}' | |
local current_dir='%{$fg[yellow]%} %~%{$reset_color%}' | |
local git_branch='$(git_prompt_info)%{$reset_color%}' | |
PROMPT=" | |
${user_host}${current_dir} ${git_branch} | |
⑆ " | |
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[yellow]%}(" | |
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" |
OlderNewer