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
// For V8: | |
// Define global variable `__stack__` and `__line` | |
// for current stack and line | |
(function(global){ | |
Object.defineProperty(global, '__stack__', { | |
get: function(){ | |
var orig = Error.prepareStackTrace; | |
Error.prepareStackTrace = function(_, stack){ return stack; }; | |
var err = new Error; | |
Error.captureStackTrace(err, arguments.callee); |
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 first commented line is your dabblet’s title | |
*/ | |
html, body { | |
background: #f06; | |
height: 100%; | |
} | |
#ctn { |
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
.hd, .ft { | |
height: 20px; | |
background-color: red; | |
} | |
.bd::after { | |
content: ''; | |
clear: both; | |
height: 0; | |
line-height: 0; | |
visibility: hidden; |
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
.hd, .ft { | |
height: 20px; | |
background-color: red; | |
} | |
.bd::after { | |
content: ''; | |
clear: both; | |
height: 0; | |
line-height: 0; | |
visibility: hidden; |
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
JSON.parse('') | |
// SyntaxError: Unexpected end of input | |
JSON.parse('vds') | |
// SyntaxError: Unexpected token v |
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
function check() { | |
var hash = {}, | |
key, | |
times = Math.pow(10, 9), | |
i = 1; | |
do { | |
key = create3(); | |
if (hash[key]) { |
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
git checkout topic-branch | |
git rebase master | |
git checkout master | |
git merge topic-branch |
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
// RegExp for English & Chinese usual sentence, which is reuseable | |
[\s\w\。\,\、\`\:\~\`\!\@\#\$\%\^\&\*\(\)\-\_\+\=\{\}\[\]\|\;\:\"\'\<\>\,\.\/\?]*?\n | |
// Whole RegExp for change my fucking annotation style, which is: | |
// /** | |
// * balabala | |
// * foo | |
// **/ | |
// search via it and replace with $1$3 **twice**, and than there is a new annotation style: |
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
(function evaluate(){ | |
var ifr = document.querySelector('#iframeautoheight'), | |
ifrDoc = ifr.contentDocument, | |
selects = ifrDoc.querySelector('#DataGrid1').querySelectorAll('.select'), | |
i, l, | |
options, | |
submitBtn = ifrDoc.querySelector('#Button2'); | |
if( submitBtn.value.search(/提\s*交/) === -1 ){ | |
for(i = 0, l = selects.length; i < l; ++i){ |
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
.wrapper { | |
width:90%; | |
margin: auto; | |
overflow: hidden; | |
zoom: 1; | |
background: beige; | |
} | |
.nav { | |
float: left; |
NewerOlder