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
async function pr(v) { console.log("pr(" + v + ")"); } | |
async function f() { for (var i = 0; i < 10; i++) { await pr(i); } return 0; } | |
function ct(v) { console.log("counter" + v); if (v > 0) Promise.resolve(v - 1).then(ct); } | |
ct(10); f(); |
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
curl --include \ | |
--no-buffer \ | |
--header "Connection: Upgrade" \ | |
--header "Upgrade: websocket" \ | |
--header "Host: example.com:80" \ | |
--header "Origin: http://example.com:80" \ | |
--header "Sec-WebSocket-Key: SGVsbG8sIHdvcmxkIQ==" \ | |
--header "Sec-WebSocket-Version: 13" \ | |
http://example.com:80/ |
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
""" | |
Copies all keys from the source Redis host to the destination Redis host. | |
Useful to migrate Redis instances where commands like SLAVEOF and MIGRATE are | |
restricted (e.g. on Amazon ElastiCache). | |
The script scans through the keyspace of the given database number and uses | |
a pipeline of DUMP and RESTORE commands to migrate the keys. | |
Requires Redis 2.8.0 or higher. |
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
#!/usr/bin/env ruby | |
require 'octokit' | |
pass_re = /^password: "(.*)"$/ | |
token = `security find-generic-password -s "GitHub API Token" -g 2>&1 | grep "password"`.match(pass_re)[1] | |
c = Octokit::Client.new(:access_token => token) | |
user_login = c.user.login |
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
<h1>Using both small and large grids</h1> | |
<ul class='small-block-grid-2 large-block-grid-4'> | |
<li><img src='http://placekitten.com/g/200/220' /></li> | |
<li><img src='http://placekitten.com/g/200/200' /></li> | |
<li><img src='http://placekitten.com/g/200/280' /></li> | |
<li><img src='http://placekitten.com/g/200/250' /></li> | |
<li><img src='http://placekitten.com/g/200/240' /></li> | |
<li><img src='http://placekitten.com/g/200/270' /></li> | |
<li><img src='http://placekitten.com/g/200/230' /></li> |