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
var x = 10; | |
while (x --> 0) { // x goes to 0 | |
console.log(x); | |
} |
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
input::-webkit-input-placeholder { /* WebKit browsers */ | |
color: red; | |
} | |
input:-moz-placeholder { /* Mozilla Firefox 4 to 18 */ | |
color: red; | |
opacity: 1; | |
} | |
input::-moz-placeholder { /* Mozilla Firefox 19+ */ | |
color: red; | |
opacity: 1; |
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 getLocale() { | |
var lang; | |
if (navigator.languages) { | |
// chrome does not currently set navigator.language correctly https://code.google.com/p/chromium/issues/detail?id=101138 | |
// but it does set the first element of navigator.languages correctly | |
lang = navigator.languages[0]; | |
} else if (navigator.userLanguage) { | |
// IE only | |
lang = navigator.userLanguage; |
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
var w = window, | |
d = document, | |
e = d.documentElement, | |
g = d.getElementsByTagName('body')[0], | |
x = w.innerWidth || e.clientWidth || g.clientWidth, | |
y = w.innerHeight|| e.clientHeight|| g.clientHeight; | |
console.log(x + '×' + y); |
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
<?php | |
$opcodes = FineDiff::getDiffOpcodes($before, $after); | |
$result = ''; | |
FineDiff::renderFromOpcodes($_POST['raw'], $opcodes, function($opcode, $from, $from_offset, $from_len) use (&$result) { | |
if ($opcode === 'c') { | |
$result .= htmlspecialchars(mb_substr($from, $from_offset, $from_len)); | |
} | |
else if ($opcode === 'd') { | |
$deletion = mb_substr($from, $from_offset, $from_len); |
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
hr { | |
color: #555; /* for IE */ | |
background-color: #555; /* for Chrome, Firefox, Opera, Safari */ | |
border: 0 none; | |
height: 1px; /* for 1px IE, Chrome, Firefox, Opera, Safari */ | |
clear: both; /* if tag follows floating element */ | |
} |
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
// Disable completely | |
window.alert = function() {}; | |
// Or keep logging | |
window.alert = function(text) { console.log('alert: '+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
git reset HEAD^ --hard | |
git push origin <branchname> -f |
NewerOlder