Skip to content

Instantly share code, notes, and snippets.

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
<div class="myvideo">
<iframe src="http://www.youtube.com/embed/MY-VIDEO" frameborder="0" allowfullscreen></iframe>
</div>
// Standard device screen widths
$iphone-portrait: 320px
$iphone-landscape: 480px
$ipad-portrait: 767px
$ipad-landscape: 980px
$desktop: 1224px
$desktop-large: 1824px
// General device targeting
// Use: Only use if you want the style to apply to many devices
<table>
<thead>
<tr>
<th scope="col">Name</th>
<th scope="col">Email</th>
<th scope="col">Dept, Title</th>
<th scope="col">Phone</th>
</tr>
</thead>
<tbody>
/* ---------------------------------------------------------- */
/* */
/* A media query that captures: */
/* */
/* - Retina iOS devices */
/* - Retina Macs running Safari */
/* - High DPI Windows PCs running IE 8 and above */
/* - Low DPI Windows PCs running IE, zoomed in */
/* - Low DPI Windows PCs and Macs running Firefox, zoomed in */
/* - Android hdpi devices and above */
@b4z81
b4z81 / Custom.css
Created October 10, 2012 10:04 — forked from bentruyman/Custom.css
IR_Black Theme for Chrome Developer Tools
/**********************************************/
/*
/* IR_Black Skin by Ben Truyman - 2011
/*
/* Based on Todd Werth's IR_Black:
/* http://blog.toddwerth.com/entries/2
/*
/* Inspired by Darcy Clarke's blog post:
/* http://darcyclarke.me/design/skin-your-chrome-inspector/
/*
@b4z81
b4z81 / snippet.js
Created July 10, 2012 15:39 — forked from necolas/snippet.js
Optimised async loading of cross-domain scripts
/*
* Updated to use the function-based method described in http://www.phpied.com/social-button-bffs/
* Better handling of scripts without supplied ids.
*
* N.B. Be sure to include Google Analytics's _gaq and Facebook's fbAsyncInit prior to this function.
*/
(function(doc, script) {
var js,
fjs = doc.getElementsByTagName(script)[0],
@b4z81
b4z81 / gist:2710788
Created May 16, 2012 14:31 — forked from bjankord/gist:2572749
Picture Source src modification through CSS image-set and URI Templates
<head>
<style type="text/css">
picture source {
src: image-set(url({filename}@2x.{ext} 2x high-bandwidth));
}
@media screen and (min-width:321px){
picture source {
src: image-set(url({filename}-m.{ext}), url({filename}-m@2x.{ext} 2x high-bandwidth));
}
}
@b4z81
b4z81 / detection.js
Created May 9, 2012 10:21
Device Detection
var $window = $(window);
windowWidth = $window.width();
if(screen.width > 959) { // check the size of the monitor
isDestkop = TRUE;
}
elseif(windowWidth > 520 && windowWidth < 959){ // check the size of the browser
isTablet = TRUE;
}
else{
@b4z81
b4z81 / features.js.php
Created May 7, 2012 16:54
Detector perrequest
<?php
// to be included in your <head></head> tag to run the per-request tests
require(TEMPLATEPATH."/detector/Detector.php");
header("content-type: application/x-javascript");
$test = Detector::perrequest();
?>