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
#ifndef SCOPEGUARD_H | |
#define SCOPEGUARD_H | |
template <typename Fun> | |
class ScopeGuard { | |
public: | |
ScopeGuard(Fun f) : f_(std::move(f)), active_(true) {} | |
~ScopeGuard() { | |
if (active_) { | |
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
// extern "C" not handled | |
#include <typeinfo> | |
#include <type_traits> | |
#include <string> | |
template<class...> struct Printtype; | |
template<> struct Printtype<> { | |
std::string name() { | |
return ""; | |
} |
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
(defn lazy-primes [] | |
(letfn [(enqueue [sieve n step] | |
(let [m (+ n step)] | |
(if (sieve m) | |
(recur sieve m step) | |
(assoc sieve m step)))) | |
(next-sieve [sieve candidate] | |
(if-let [step (sieve candidate)] | |
(-> sieve | |
(dissoc candidate) |
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
<!doctype html> | |
<head> | |
<title>Canvas Data</title> | |
</head> | |
<body> | |
<canvas id="canvas" width="1500" height="2000" style="position: absolute; top: 0px; left: 0px;"></canvas> | |
</body> | |
<script> | |
var theCanvas = document.getElementById('canvas'); | |
var context = theCanvas.getContext('2d'); |
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
<!doctype html> | |
<html> | |
<head> | |
<title>striker</title> | |
</head> | |
<body align="center" style="margin:0;"> | |
<canvas id="canvas" width="1500" height="900"></canvas> | |
<script> | |
// class inherit | |
function inherits(ctor, superCtor) { |
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
package main | |
import ( | |
"fmt" | |
"io" | |
"io/ioutil" | |
"net" | |
"net/http" | |
"sync" | |
"time" |
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
package main | |
import ( | |
"fmt" | |
"regexp" | |
"strings" | |
) | |
const cueInfo = `FILE "01 遺サレタ場所:丁.wav" WAVE | |
TRACK 01 AUDIO |
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
/* | |
CSS stylesheet is based on Kevin Burke's Markdown.css project: | |
http://kevinburke.bitbucket.org/markdowncss | |
For code highlighting: | |
<link rel="stylesheet" href="http://yandex.st/highlightjs/6.1/styles/magula.min.css"> | |
<script src="http://yandex.st/highlightjs/6.1/highlight.js"></script> | |
<script src="http://yandex.st/highlightjs/6.1/languages/cpp.min.js"></script> | |
<script>hljs.initHighlightingOnLoad();</script> | |
*/ |
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
#!/bin/bash | |
FQDN=$1 | |
# make directories to work from | |
mkdir -p server/ client/ all/ | |
# Create your very own Root Certificate Authority | |
openssl genrsa \ | |
-out all/my-private-root-ca.privkey.pem \ | |
2048 |