Skip to content

Instantly share code, notes, and snippets.

@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 -->

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 / 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';
actor Main
new create(env: Env) =>
let yep: Array[U32] = [1]
let nope: Array[U32] = [1, 2]
@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)
]
@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 / 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 / object_ast
Last active December 19, 2017 21:24
pony AST error message for syntax pass on object literal
(class:scope
(id $1$0)
x
ref
(provides (nominal x (id Getter) x x x))
(members
(fvar (id d) (nominal (id $0) (id Bool) x val x x) x)
(fvar (id c) (nominal (id $0) (id Bool) x val x x) x)
(fvar (id b) (nominal (id $0) (id Bool) x val x x) x)
(fvar (id a) (nominal (id $0) (id Bool) x val x x) x)
@mfelsche
mfelsche / scratch.pony
Created March 26, 2018 07:37
Code to reproduce weird `String.cstring()` behaviour in ponyc
use "net"
use "cli"
use "debug"
actor Main
new create(env: Env) =>
try
let spec = CommandSpec.leaf("damn", "", [
OptionSpec.string("addr",
"The host:port:name to be advertised to other clustering nodes."
@mfelsche
mfelsche / promises_ext.pony
Created December 11, 2018 19:53
first function for promises - returning the first fulfilled value
use "promises"
use "collections"
actor _Selector[A: Any #share]
var _completed: Bool = false
var _outstanding: USize
let _promise: Promise[A]
new create(promise: Promise[A], expected: USize) =>
_promise = promise