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
n -s "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" /usr/bin/subl |
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
*, | |
*:before, | |
*:after { | |
-moz-box-sizing: border-box; | |
-webkit-box-sizing: border-box; | |
box-sizing: border-box; | |
} |
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
# copies the SSH key in id_rsa.pub to your clipboard | |
pbcopy < ~/.ssh/id_rsa.pub |
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
# generates a SSH key for use with GitHub, etc | |
ssh-keygen -t rsa -C "your_email@example.com" |
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
/* 5px shadow in every distance, with blur of 5 and spread of 6 */ | |
.foo { | |
-moz-box-shadow: -5px -5px 5px 6px #888; | |
-webkit-box-shadow: -5px -5px 5px 6px#888; | |
box-shadow: -5px -5px 5px 6px #888; | |
} | |
/* 5px inner shadow in every distance */ | |
.bar { | |
-moz-box-shadow: inset 0 0 5px 5px #888; |
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
/* Better type detection */ | |
/* | |
- Checking a supposed array for a method like slice() isn't robust enough, as there's no reason why a non-array couldn't have a method of the same name | |
- instanceof Array works incorrectly when used across frames in some IE versions | |
*/ | |
// ARRAY | |
var alpha = []; | |
console.log( typeof alpha ); // "object" | |
console.log( alpha.constructor === Array ); // true | |
console.log( Object.prototype.toString.call( alpha ) ); // "[object Array]" |
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
/* Repeat a character (or set of characters) n times */ | |
var dashes = new Array( 21 ).join( '-' ); // Outputs 20 dashes |
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
/* isArray() in ECMAScript < 5 */ | |
if ( typeof Array.isArray === "undefined" ) { | |
Array.isArray = function ( arg ) { | |
return Object.prototype.toString.call( arg ) === "[object Array]"; | |
}; | |
} |
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
.foo { | |
overflow: auto; | |
overflow-y: hidden; | |
-ms-overflow-y: hidden; /* IE8 fix */ | |
} |
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
/* The Error Object */ | |
try { | |
// something bad happened, throw an error | |
throw { | |
name : "MyErrorType", // custom error type | |
message : "oops", | |
extra : "This was rather embarrassing", | |
remedy : genericErrorHandler // who should handle it | |
}; | |
} catch ( e ) { |
OlderNewer