Skip to content

Instantly share code, notes, and snippets.

View rewritten's full-sized avatar
🏠
Working from home

Saverio Trioni rewritten

🏠
Working from home
View GitHub Profile
@rewritten
rewritten / unnamed_types_bug.exs
Created December 5, 2023 17:25
Proof of concept for the unnamed types issues in Avrora
Mix.install([:erlavro, :avrora, :jason])
record = %{"id" => 1, "name" => "test"}
record_schema = """
{
"type": "record",
"name": "TestRecord",
"fields": [
{"name": "id", "type": "int"},
---
BUNDLE_BUILD__PG: "--with-opt-dir=/usr/local/opt/libpq"
BUNDLE_BUILD__PUMA: "--with-cflags=-Wno-error=implicit-function-declaration"
@rewritten
rewritten / example.js
Created September 16, 2016 17:00
Example wrapper + functio + document:ready + turbolinks:load
/////////////////////////////////////////////////////////
// Normal wrapper, using globals inside of it, but
// local variables and functions are not leaking out.
(function () {
// function to execute on load
var circle = function () {
// do stuff
};
@rewritten
rewritten / xhyve-up
Last active April 2, 2016 06:51
Script to start a machine under xhyve without docker or other middlemen.
#!/bin/sh
KERNEL="vmlinuz"
INITRD="initrd.gz"
CMDLINE="earlyprintk=serial console=ttyS0 acpi=off"
MEM="-m 1G"
NET="-s 2:0,virtio-net"
IMG_CD="-s 3,ahci-cd,ubuntu.iso"
IMG_HDD="-s 4,virtio-blk,hdd.img"
PCI_DEV="-s 0:0,hostbridge -s 31,lpc"
LPC_DEV="-l com1,stdio"
@rewritten
rewritten / cancellable_http.js.coffee
Created November 11, 2014 20:45
Wrap http with a global canceler.
# blatantly inspired and actually almost copied from
# https://www.exratione.com/2013/08/angularjs-wrapping-http-for-fun-and-profit/
# BEWARE: not tested in any way
# create the decorator
$cancellableHttp = ($delegate, $q) ->
$http = $delegate
canceler = null