This file contains hidden or 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
// Safe to say...textarea is a good idea: <textarea id="pasteField"></textarea> | |
$( '#pasteField' ).on( 'paste', function( evt ) { | |
// Safari has a weird "types" list that we need to loop through and no "items" array. | |
var i = 0, items = [], item, key = 'text/plain', kind = 'string'; | |
while (i < evt.originalEvent.clipboardData.types.length) { | |
var key = evt.originalEvent.clipboardData.types[i]; | |
if( !key.match( /(text\/)|(plain-text)/i ) ) { | |
kind = 'file'; | |
} |
This file contains hidden or 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
// We need a textarea for IE, too: <textarea id="pasteField"></textarea> | |
$( '#pasteField' ).bind( 'paste', function( evt ) { | |
// In true Microsoft form, the type to get plain text is Text with a captial T. | |
console.log( window.clipboardData.getData( 'Text' ) ); | |
} ); |
This file contains hidden or 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
<textarea id="pasteField"></textarea> |
This file contains hidden or 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
$( 'body' ).bind( 'paste', function( evt ) { | |
var items = evt.originalEvent.clipboardData.items | |
, paste; | |
// Items have a "kind" (string, file) and a MIME type | |
console.log( 'First item "kind":', items[0].kind ); | |
console.log( 'First item MIME type:', items[0].type ); | |
// If a user pastes image data, there are 2 items: the file name (at index 0) and the file (at index 1) | |
// but if the user pastes plain text or HTML, index 0 is the data with markup and index 1 is the plain, unadorned text. |
This file contains hidden or 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
#!/bin/bash | |
# <UDF name="ssh_key" Label="Paste in your public SSH key" default="" example="" optional="false" /> | |
# root ssh keys | |
mkdir /root/.ssh | |
echo $SSH_KEY >> /root/.ssh/authorized_keys | |
chmod 0700 /root/.ssh | |
# update to latest |
This file contains hidden or 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
/** | |
* Lazy load assets, call callback fn after all assets have loaded. | |
* | |
* Requires: jQuery or Zepto | |
* | |
* Usage: | |
* Lazy.load({"js": ["js/file.js"], | |
* "tpl": [{"src": "tpl/event.tpl", "id": "event-view"}], | |
* "css": ["css/file.css"] | |
* }); |
This file contains hidden or 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
PS1="\[\e[0:32m\]\w \[\e[0;39m\]\$ " | |
if [ -f ~/.git-completion.bash ]; then | |
source ~/.git-completion.bash | |
PS1="\[\e[0:32m\]\w"'$(__git_ps1 " \[\e[1;30m\](%s)")'"\[\e[0;39m\]\$ " | |
fi | |
export CLICOLOR=1 | |
export ll='ls -al' |
This file contains hidden or 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
[user] | |
name = | |
email = | |
[core] | |
editor = /usr/bin/nano | |
excludesfile = /Users/username/.gitignore | |
[merge] | |
conflictstyle = diff3 | |
[color] | |
branch = auto |
This file contains hidden or 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
iPad | |
1024 × 690 In landscape on iOS 4.3 | |
1024 × 672 In landscape on iOS 5 | |
768 × 946 In portrait on iOS 4.3 | |
768 × 928 In portrait on iOS 5 | |
1024 × 660 Always showing bookmarks bar in landscape on iOS 4.3 | |
1024 × 644 Always showing bookmarks bar in landscape on iOS 5 | |
768 × 916 Always showing bookmarks bar in portrait on iOS 4.3 |
This file contains hidden or 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 nodewatch() { | |
find . | grep coffee$ | xargs coffee -cwl & | |
if [ $1 ] | |
then | |
nodemon $1.js & | |
else | |
nodemon app.js & | |
fi | |