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
| #include <stdarg.h> | |
| #include <stdio.h> | |
| #include <stdlib.h> | |
| char const syms[] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', | |
| 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', | |
| 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', | |
| 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', | |
| 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '0', '1', '2', | |
| '3', '4', '5', '6', '7', '8', '9', '+', '/'}; |
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
| #include <cstdio> | |
| #include <string> | |
| enum { FIELD_SIZE = 8 }; | |
| void parse(int* out, int n, char const* s) { | |
| if (!s || n <= 0) { | |
| return; | |
| } | |
| int k = n * FIELD_SIZE; |
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
| 'use strict'; | |
| function main() { | |
| const args = process.argv.slice(2); | |
| return asBits(args, (err, s) => { | |
| if (err) { | |
| console.error(err); | |
| return process.exit(1); | |
| } | |
| return console.log(s); |
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
| #include <functional> | |
| #include <iostream> | |
| #include <string> | |
| #include <vector> | |
| // clang++ -std=c++11 -stdlib=libc++ -Wall handler_wrap.cpp -o handler_wrap | |
| // g++ -std=c++11 -Wall handler_wrap.cpp -o handler_wrap | |
| // Message Type #1 | |
| class Foo { |
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
| #include <algorithm> | |
| #include <functional> | |
| #include <iostream> | |
| #include <vector> | |
| // clang++ -std=c++11 -stdlib=libc++ -Wall ptr_fun.m.cpp -o ptr_fun | |
| // g++ -std=c++11 -Wall ptr_fun.m.cpp -o ptr_fun | |
| class Foo { | |
| public: |
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
| 'use strict'; | |
| const assert = require('assert'), | |
| fs = require('fs'), | |
| readGraph = require('./readGraph'); | |
| let stream = process.argv[2] ? | |
| fs.createReadStream(process.argv[2]) : process.stdin; | |
| readGraph(stream, (err, g) => { |
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
| #!/bin/bash | |
| set -o nounset | |
| set -o errexit | |
| # Needed for sed (Mac OS X sed does not understand \t) | |
| TAB="$(printf '\t')" | |
| TEMP='temp' | |
| SUB='sub' | |
| GIT='/usr/local/bin/git' # set to git executable |
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
| $ curl --user 'officialApiClient:C0FFEE' http://localhost:8181/token -d 'grant_type=client_credentials' | \ | |
| json access_token | xargs -I tok curl -H "Authorization: Bearer tok" http://localhost:8181/secret | json |
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 first(cb) { | |
| console.log('hello from first...'); | |
| cb(); | |
| } | |
| function second(cb) { | |
| console.log('hello from second...'); | |
| cb(); | |
| } |
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 path = require('path'), | |
| fs = require('fs'), | |
| http = require('http'); | |
| http.createServer(function(req, res) { | |
| var file = path.normalize('.' + req.url); | |
| console.log('Trying to serve ', file); | |
| function reportError(err) { | |
| console.log(err); |
NewerOlder