Attention: the list was moved to
https://github.com/dypsilon/frontend-dev-bookmarks
This page is not maintained anymore, please update your bookmarks.
| // Use Gists to store code you would like to remember later on | |
| console.log(window); // log the "window" object to the console | 
| { | |
| "tab_size": 2, | |
| "translate_tabs_to_spaces": false, | |
| "trim_trailing_white_space_on_save": true, | |
| } | 
| function getBase64Image(img) { | |
| // Create an empty canvas element | |
| var canvas = document.createElement("canvas"); | |
| var canvasImg = new Image(); | |
| $(canvasImg).attr('src',img.src); | |
| console.log(img); | |
| console.log(canvasImg); | |
| // Copy the image contents to the canvas | |
| var ctx = canvas.getContext("2d"); | 
| // private method | |
| // Wraps the HTML in a TAG, Tag is optional | |
| // If the html starts with a Tag, it will wrap the context in that tag. | |
| // doesn't ACTUALLY work | |
| function wrap(xhtml, tag) { | |
| // new approach | |
| // createDocumentFragment | |
| var docFrag = document.createDocumentFragment(), | |
| dummy, | |
| wrapTag; | 
Attention: the list was moved to
https://github.com/dypsilon/frontend-dev-bookmarks
This page is not maintained anymore, please update your bookmarks.
| <script type="text/javascript"> | |
| $('select').each(function () { | |
| var title = this.options[this.selectedIndex].text; | |
| $(this).css({ opacity: '0', zIndex: '9999' }); | |
| $(this).after('<span class="select">' + title + '</span>'); | |
| }); | |
| $('select').change(function () { | |
| var getvalue = this.value; | |
| var title = this.options[this.selectedIndex].text; | 
| <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script> | |
| <script>window.jQuery || document.write('<script src="js/vendor/jquery-1.10.1.min.js"><\/script>')</script> | 
| /* See http://mrdanadams.com/2012/pixel-ems-css-conversion-sass-mixin/ */ | |
| /* Default font size in pixels if not overridden. */ | |
| $baseFontSize: 16; | |
| /* Convert PX units to EMs. | |
| Ex: margin-right: pem(16); | |
| */ | |
| @function pem($pxval, $base: $baseFontSize) { | |
| @return #{$pxval / $base}em; | 
| [ | |
| { "keys": ["ctrl+shift+b"], "command": "insert_snippet", "args": {"contents": "${TM_COMMENT_START/s*$//} ==${1/./=/g}==${TM_COMMENT_END/^s*(.+)/ $1/}\n${TM_COMMENT_START/s*$//} = ${1:Banner} =${TM_COMMENT_END/^s*(.+)/ $1/}\n${TM_COMMENT_START/s*$//} ==${1/./=/g}==${TM_COMMENT_END/^s*(.+)/ $1/}"}}, | |
| { "keys": ["super+shift+l"], | |
| "command": "insert_snippet", | |
| "args": { | |
| "contents": "console.log(${1:}$SELECTION);${0}" | |
| }, "context": | |
| [ | 
| [ | |
| { "keys": ["ctrl+shift+b"], "command": "insert_snippet", "args": {"contents": "${TM_COMMENT_START/s*$//} ==${1/./=/g}==${TM_COMMENT_END/^s*(.+)/ $1/}\n${TM_COMMENT_START/s*$//} = ${1:Banner} =${TM_COMMENT_END/^s*(.+)/ $1/}\n${TM_COMMENT_START/s*$//} ==${1/./=/g}==${TM_COMMENT_END/^s*(.+)/ $1/}"}}, | |
| { "keys": ["super+shift+l"], | |
| "command": "insert_snippet", | |
| "args": { | |
| "contents": "console.log(${1:}$SELECTION);${0}" | |
| }, "context": | |
| [ |