Skip to content

Instantly share code, notes, and snippets.

@mfelsche
mfelsche / buffered-ast.txt
Created July 29, 2017 23:17
incomplete actor ast print
(program:scope
(package:scope
(module:scope
(use x "builtin" x)
(use x "ponytest" x)
(actor:scope
(id Main)
x
tag
(provides (nominal (id $2) (id TestList) x ref x x))
@mfelsche
mfelsche / Dockerfile
Last active June 1, 2017 20:06
Dockerfile installing ponyc deb from bintray repo and llvm-3.9 from http://apt.llvm.org
FROM ubuntu:xenial¬
¬
ENV LLVM_VERSION 3.9.1¬
¬
RUN apt-get update \¬
&& apt-get install -y \¬
apt-transport-https \¬
g++ \¬
@mfelsche
mfelsche / arrays.pony
Last active April 10, 2017 07:11
Array Literal Types in Pony
type MyUnionType is (U32|I32|U8)
actor Main
new create(env: Env) =>
let union_array: Array[MyUnionType] = [
as MyUnionType: U32(1)
I32(-1)
]
actor Main
new create(env: Env) =>
let yep: Array[U32] = [1]
let nope: Array[U32] = [1, 2]
@mfelsche
mfelsche / proxy.pac
Last active August 26, 2016 08:02 — forked from amiorin/proxy.pac
function regExpMatch(url, pattern) {
try { return new RegExp(pattern).test(url); } catch(ex) { return false; }
}
function FindProxyForURL(url, host) {
// Important: replace 172.31 below with the proper prefix for your VPC subnet
if (shExpMatch(url, "*172.31.*")) return "SOCKS5 localhost:8157";
if (shExpMatch(url, "*internal-jenkins-nuggad-*.eu-central-1.elb.amazonaws.com*")) return "SOCKS5 localhost:8157";
if (shExpMatch(url, "*ec2*.amazonaws.com*")) return 'SOCKS5 localhost:8157';
if (shExpMatch(url, "*.compute.internal*") || shExpMatch(url, "*://compute.internal*")) return 'SOCKS5 localhost:8157';

Keybase proof

I hereby claim:

  • I am mfelsche on github.
  • I am mwahl (https://keybase.io/mwahl) on keybase.
  • I have a public key ASC1D_9MBKNxz8Gppj1hK_POKBHOqefJTZK7pTjTBur0BQo

To claim this, I am signing this object:

@mfelsche
mfelsche / ga.patch
Last active September 1, 2015 19:18
diff --git a/plugins/crate-admin/_site/index.html b/plugins/crate-admin/_site/index.html.new
index 3b55c74..35f7cff 100644
--- a/app/index.html
+++ b/app/index.html
@@ -96,5 +96,28 @@
</div>
</div>
+ <!-- Begin Analytics-->
+ <!-- Google Analytics Start -->
@mfelsche
mfelsche / bar_graph_deviation_potsdam.r
Last active August 29, 2015 14:24
simple bar graph
library(ggplot2)
# deviation_potsdam.csv has been created using crash:
# bin/crash --format=csv -c "SELECT format('%tY', date) AS year, AVG(temp) - 8.659611756762368 as deviation FROM german_climate_denormalized WHERE temp IS NOT NULL AND station_name = 'Potsdam' and date < '2015-01-01' GROUP BY 1 ORDER BY 1 ASC" > deviation_potsdam.csv
frame <- read.table('deviation_potsam.csv', header=TRUE, sep=",")
negative <- frame$deviation < 0
# create the png
png("deviation_potsdam.png", width=900, height=480)
print(
ggplot(
@mfelsche
mfelsche / amplab_tables.sql
Created January 29, 2015 11:13
amplab tables
create table rankings (
"pageURL" string primary key,
"pageRank" int,
"avgDuration" int
) clustered into 48 shards with (number_of_replicas=0, refresh_interval=0);
create table uservisits (
"sourceIP" string,
"destinationURL" string,
"visitDate" timestamp,
$ mix deps.compile
==> idna (compile)
Compiled src/idna.erl
Compiled src/idna_ucs.erl
Compiled src/idna_unicode.erl
Compiled src/punycode.erl
Compiled src/idna_unicode_data.erl
==> ssl_verify_hostname (compile)
Compiled src/ssl_verify_hostname.erl
==> jsx (compile)