⌘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
// TODO: remove spaces and newlines | |
javascript:(function(){ | |
s=document.createElement('script'); | |
s.type='text/javascript'; | |
s.src='http://example.com/bookmarklet.js'; | |
document.body.appendChild(s); | |
})(); | |
// TODO: bookmarklet code needs to be in an anchor tag | |
// <a href="javascript:(function(){s=document.createElement('script');s.type='text/javascript';s.src='http://example.com/bookmarklet.js';document.body.appendChild(s);})();">My Bookmarklet</a> |
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 vrtAds = (function ( document, undefined) { | |
var results = document.querySelectorAll('#leaderboard, #skyscraper, .block-canvas_doormat_advertising, #adh_textlink_wrapper'); | |
for (var i = 0; i < results.length; i++) { | |
//console.log(results[i].style.display); | |
results[i].style.display = 'none'; | |
} | |
}(document)); | |
// paste the following in a bookmarklet | |
// javascript:var%20vrtAds%20=%20(function%20(%20document,%20undefined)%20{var%20results%20=%20document.querySelectorAll(%27#leaderboard,%20#skyscraper,%20.block-canvas_doormat_advertising,%20#adh_textlink_wrapper%27);for%20(var%20i%20=%200;%20i%20<%20results.length;%20i++)%20{console.log(results[i].style.display);results[i].style.display%20=%20%27none%27;}}(document)); |
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 | |
/* | |
* Implements hook_preprocess_image_formatter() to add tabindex to teaser img links | |
*/ | |
function theme_preprocess_image_formatter(&$vars) { | |
if ($vars['image_style'] == "yourimagestyle") { | |
if(!empty($vars['path'])) { | |
$vars['path']['options']["attributes"]["tabindex"] = -1; | |
} |
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 mod = (function (window, document, $, undefined) { | |
var my = {}, | |
privateVar = 'bazinga'; | |
my.init = function () { | |
// ... | |
} | |
return my; | |
})(window, document, jQuery); |
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
git branch --set-upstream master origin/master |
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
$ rm .git/index | |
$ git reset --hard HEAD |
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
# try to load from live site | |
# place in local files folder | |
<IfModule mod_rewrite.c> | |
RewriteEngine on | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteRule (.*) http://i.am.production.url/to-files/$1 | |
</IfModule> |
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 theme_panels_default_style_render_region($vars) { | |
$output = ''; | |
$output .= implode('', $vars['panes']); | |
return $output; | |
} |
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
# folder aliases | |
alias home="cd ~" | |
alias p="cd ~/gitprojects" | |
alias dropbox="cd ~/Dropbox" | |
alias sites="cd ~/Sites" | |
alias desk="cd ~/Desktop" | |
alias logs="subl /Applications/MAMP/logs" | |
alias hosts="subl ~/Desktop/.alias/_vhosts" | |
# app aliases |