Skip to content

Instantly share code, notes, and snippets.

View metasansana's full-sized avatar
🕺
Wine on a buffer.

Lasana Murray metasansana

🕺
Wine on a buffer.
View GitHub Profile
@metasansana
metasansana / gist:c2e242ff3b4d298a3a45
Last active August 29, 2015 14:14
Generic Form as directive with controller
var app = angular.module('myApp', []);
app.directive('contactGeneric', function () {
return {
restrict: 'E',
templateUrl: 'contactGeneric.html',
bindToController: true,
controllerAs: 'contactGeneric',
controller: ['$http', function ($http) {

browserify for webpack users

There's been a strange explosion in misinformation about browserify recently, particularly in comparisons to webpack.

Generally speaking, most of this confusion stems from how webpack is more willing to pull features into its core to ease discoverability while browserify is more likely to push features out to userland instead.

I think that longer-term, separability has more benefits from a maintenance and

@metasansana
metasansana / potoo.ts
Last active May 18, 2017 10:47
Attempt at actor model in typescript.
import { match } from 'afpl/lib/control/Match';
import { Suspend, Return, liftF } from 'afpl/lib/monad/Free';
import { Maybe, fromAny } from 'afpl/lib/monad/Maybe';
import { IO, safeIO, wrapIO } from 'afpl/lib/monad/IO';
import { Free } from 'afpl/lib/monad/Free';
import { Functor } from 'afpl/lib/data/Functor';
import { identity, compose } from 'afpl/lib/util';
import { SharedBuffer } from 'afpl/lib/async/SharedBuffer';
/**
@metasansana
metasansana / debounce.js
Created September 2, 2017 22:32
Quick JavaScript/Typescript debounce function.
const debounce = (f, delay) => {
let timer = null;
return a=> {
if(!timer) {
timer = setTimeout(a=>f(a), delay);
}else{
@metasansana
metasansana / install_mongodb.sh
Last active February 28, 2023 16:59
Installs and starts mongodb on a github runner for tests.
wget -qO - https://www.mongodb.org/static/pgp/server-6.0.asc | sudo apt-key add -
echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu jammy/mongodb-org/6.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-6.0.list
sudo apt-get update
sudo apt-get install -y mongodb-org
sudo systemctl daemon-reload
sudo systemctl start mongod