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
| /* | |
| Used like this: | |
| var regex = regex_escape([ | |
| 'foo', | |
| 'bar', | |
| 'http://example.com/page' | |
| ]); |
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() { | |
| if (!window.console) { | |
| window.console = {}; | |
| } | |
| // union of Chrome, FF, IE, and Safari console methods | |
| var m = [ | |
| "log", "info", "warn", "error", "debug", "trace", "dir", "group", | |
| "groupCollapsed", "groupEnd", "time", "timeEnd", "profile", "profileEnd", | |
| "dirxml", "assert", "count", "markTimeline", "timeStamp", "clear" | |
| ]; |
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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="utf-8"> | |
| <title>Drive Google's Streetview Car</title> | |
| <style> | |
| html, body { | |
| height: 100%; | |
| margin: 0; |
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
| // Escape regular expression | |
| function regex_escape(thing) { | |
| // Escape the string | |
| function esc(str) { | |
| return str.toString().replace(/([.?*+^$[\]\\(){}|-])/g, '\\$1'); | |
| } | |
| // Used in loop | |
| var arr, i; |
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
| data:text/html, <style type="text/css">#e{position:absolute;top:0;right:0;bottom:0;left:0;}</style><div id="e"></div><script src="http://d1n0x3qji82z53.cloudfront.net/src-min-noconflict/ace.js" type="text/javascript" charset="utf-8"></script><script>var e=ace.edit("e");e.setTheme("ace/theme/solarized_light");e.getSession().setMode("ace/mode/javascript");</script> |
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
| /** | |
| * Clip image to hexagon | |
| */ | |
| img { | |
| max-width: 200px; | |
| max-height: 200px; | |
| } |
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
| // Question: which combinations with a maximum length of 4 are unused in international Morse code? | |
| // http://en.wikipedia.org/wiki/Morse_code | |
| var morseCodes = { | |
| '.-': 'A', | |
| '-...': 'B', | |
| '-.-.': 'C', | |
| '-..': 'D', | |
| '.': 'E', | |
| '..-.': 'F', |
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
| /** | |
| * Vertical centering with Flexbox + margin fallback | |
| * Lea Verou & David Storey | |
| */ | |
| html, body { height: 100%; } | |
| body { | |
| width: 100%; /* needed for FF */ | |
| margin: 0; |
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
| /* CSS States */ | |
| body { | |
| background: url(http://dabblet.com/img/noise.png); | |
| background-color: #F5F2F0; | |
| font-family: Georgia, serif; | |
| font-size: 18px; | |
| line-height: 1.6em; | |
| text-shadow: 0 2px 0 white; | |
| color: #222; | |
| } |
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
| /* | |
| Hide the Sidebar! | |
| */ | |
| * { | |
| margin: 0; | |
| padding: 0; | |
| border: 0; |
NewerOlder