Hello
foo
```javascript:4,5-7
hello
```
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
var fs = window.RequestFileSystem || window.webkitRequestFileSystem; | |
if (!fs) { | |
result.textContent = "check failed?"; | |
return; | |
} | |
fs(window.TEMPORARY, 100, function(fs) { | |
console.log('not in incognito mode'); | |
}, function(err) { | |
console.log('is in incognito mode'); | |
}); |
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
//author: Sun, Junyi (weibo.com/treapdb) | |
//usage: node --nouse-idle-notification --expose-gc --max-old-space-size=8192 memcached.js | |
var config ={ | |
port: 11211, | |
max_memory: 300 // default 100M bytes | |
} | |
var net = require('net'); | |
var LRU = function (max) { // this LRU implementaion is based on https://github.com/chriso/lru |
A Pen by Barrett Sonntag on CodePen.
<canvas id="canvas"></canvas>
<script>
var ctx = canvas.getContext("2d");
ctx.fillStyle = "red";
ctx.fillRect(0, 0, 8, 8);
var webp = canvas.toDataURL("image/webp"); // Chrome only?
var png = canvas.toDataURL("image/png");
var jpg = canvas.toDataURL("image/jpeg");
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
const describe = (desc, fn) => { | |
console.log(desc) | |
fn() | |
} | |
const it = (msg, fn) => describe(' ' + msg, fn) | |
const matchers = (exp) => ({ | |
toBe: (asssertion) => { | |
if (exp === assertion) { |
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 to fix native charCodeAt() | |
* | |
* Now, we can use fixedCharCodeAt("foo€", 3); for multibyte (non-bmp) chars too. | |
* | |
* @access public | |
* @see https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/String/charCodeAt | |
* @note If you hit a non-bmp surrogate, the function will return false | |
* @param str String Mixed string to get charcodes | |
* @param idx Integer Position of the char to get |
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
//require cyrpto module | |
var crypto=require('crypto'); | |
//key and iv should be same as the one in encrypt.php | |
var decipher=crypto.createDecipheriv('aes-256-cbc','12345678901234561234567890123456','1234567890123456'); | |
//since we have already added padding while encrypting, we will set autopadding of node js to false. | |
decipher.setAutoPadding(false); | |
// copy the output of encrypt.php and paste it below |
Please petition Github to support HTTPS on github pages: https://github.com/contact
Here's what I wrote:
Obviously, a lot of people want HTTPS for github pages:
Until recently, that would be difficult to implement but, as it turns out, the implementation is pretty much complete:
OlderNewer