Jon Warbrick, July 2014, V3.2 (for Ansible 1.7)
First one found from of
// A script that can pull down the result of the introspection query | |
// from a running graphql server. | |
// Dependencies: | |
// npm i -S isomorphic-fetch graphql-tag graphql apollo-client | |
// Usage: | |
// node fetch-graphql-schema [graphql url] | |
// Example: |
Jon Warbrick, July 2014, V3.2 (for Ansible 1.7)
First one found from of
function asyncFunc(e) { | |
return new Promise((resolve, reject) => { | |
setTimeout(() => resolve(e), e * 1000); | |
}); | |
} | |
const arr = [1, 2, 3]; | |
let final = []; | |
function workMyCollection(arr) { |
Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...
// see: https://github.com/chadoe/docker-cleanup-volumes
$ docker volume rm $(docker volume ls -qf dangling=true)
$ docker volume ls -qf dangling=true | xargs -r docker volume rm
# npm using https for git | |
git config --global url."https://github.com/".insteadOf [email protected]: | |
git config --global url."https://".insteadOf git:// | |
# npm using git for https | |
git config --global url."[email protected]:".insteadOf https://github.com/ | |
git config --global url."git://".insteadOf https:// |
http://freecode-freecode.blogspot.com/2008/11/how-to-gbkgb2312-and-utf-8-encoding.html | |
GB2312UTF8 = { | |
Dig2Dec : function(s){ | |
var retV = 0; | |
if(s.length == 4){ | |
for(var i = 0; i < 4; i ++){ | |
retV += eval(s.charAt(i)) * Math.pow(2, 3 - i); | |
} | |
return retV; |
Create a template service file at /etc/systemd/system/[email protected]
. The template parameter will correspond to the name
of target host:
[Unit]
Description=Setup a secure tunnel to %I
After=network.target
$ ssh <user>@<mac-without-screen> | |
$ sudo defaults write /var/db/launchd.db/com.apple.launchd/overrides.plist com.apple.screensharing -dict Disabled -bool false | |
$ sudo launchctl load /System/Library/LaunchDaemons/com.apple.screensharing.plist | |
/System/Library/LaunchDaemons/com.apple.screensharing.plist: Service is disabled | |
$ sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.screensharing.plist |
Edward Snowden answered questions after a showing of CITIZENFOUR at the IETF93 meeting; this is a transcript of the video recording.
For more information, see the Internet Society article.