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
FROM alpine:3.1 | |
RUN apk add --update ca-certificates && rm -rf /var/cache/apk/* | |
ADD . /app | |
WORKDIR /app/ | |
ENV DEVELOPMENT true | |
ENV PORT 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
#include <stdio.h> | |
#include <assert.h> | |
#include <typeinfo> | |
namespace game { | |
class Object { virtual void _(){}; }; | |
class Asteroid : public Object {}; | |
class Ship : public Object {}; | |
class Bullet : public Object {}; |
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 ( | |
"encoding/json" | |
"flag" | |
"fmt" | |
"log" | |
"net/http" | |
"os" | |
"path" |
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 issue | |
type ID int | |
type Status string | |
const ( | |
Created = Status("Created") | |
Closed = Status("Closed") | |
) |
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
<link rel="stylesheet" type="text/css" href="main.css"> | |
<link rel="stylesheet" type="text/css" href="main.js"> |
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 | |
const MaxLength = 1 << 20 | |
var ( | |
addr = flag.String("listen", ":8000", "listen for requests") | |
numprocs = flag.Int("p", runtime.NumCPU(), "number of workers to start") | |
maxqueue = flag.Int("q", runtime.NumCPU()*2, "largest queue size") | |
jobs chan Job |
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
<link rel="import" href="/tv/task/List.html"> | |
<link rel="import" href="/tv/task/Header.html"> | |
<style> | |
.tv-task-header { | |
background: #f00; | |
} | |
</style> | |
<script> | |
// some random example | |
package("task", function(exports){ |
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
public static String replace(String pattern, String input, Function<String, String> translate){ | |
Pattern p = Pattern.compile(pattern); | |
Matcher m = p.matcher(input); | |
StringBuffer result = new StringBuffer(); | |
while(m.find()){ | |
String r = translate.apply(m.group()); | |
m.appendReplacement(result, Matcher.quoteReplacement(r)); | |
} | |
m.appendTail(result); |
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
DCI = {}; | |
if(typeof window !== 'undefined'){ window.DCI = DCI; } | |
if(typeof global !== 'undefined'){ global.DCI = DCI; } | |
(function(DCI){ | |
DCI.Context = function(init, roles){ | |
var sfn = ""; | |
sfn += "\tvar $C = {};\n"; | |
sfn += "\tvar " + Object.keys(roles).join(", ") + ";\n"; | |
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 Account(code, balance) { | |
return { | |
get code(){ return code; }, | |
get balance(){ return balance; }, | |
increase: function(by){ balance += by; }, | |
decrease: function(by){ balance -= by; } | |
}; | |
} | |
function Bank(){ |