Skip to content

Instantly share code, notes, and snippets.

View andreabedini's full-sized avatar
☺️

Andrea Bedini andreabedini

☺️
View GitHub Profile
@roberth
roberth / minimod.nix
Last active June 26, 2024 08:27
Simple and quick module system alternative + thoughts and tasks
/*
minimod: A stripped down module system
TODO Comparison:
- [ ] Come up with a benchmark "logic" using plain old functions and let bindings
- [ ] Write the benchmark for the module system
- [ ] Write the benchmark for POP?
- [ ] Qualitative comparison of extensibility in the context of composable
Nixpkgs packaging logic
TODO Fine-tuning:

Monads and delimited control are very closely related, so it isn’t too hard to understand them in terms of one another. From a monadic point of view, the big idea is that if you have the computation m >>= f, then f is m’s continuation. It’s the function that is called with m’s result to continue execution after m returns.

If you have a long chain of binds, the continuation is just the composition of all of them. So, for example, if you have

m >>= f >>= g >>= h

then the continuation of m is f >=> g >=> h. Likewise, the continuation of m >>= f is g >=> h.

@rampion
rampion / LetsGetDangerous.md
Last active January 20, 2020 05:02
Let's Get Dangerous
@dwhitney
dwhitney / README.md
Last active May 17, 2024 09:25
Quick React Native with PureScript
  1. create-react-native-app purescript-app; cd purescript-app

  2. pulp init --force

  3. pulp build

  4. src/Main.js

var React = require("react");
var RN = require("react-native");

exports.text = function(props){
@slacksec
slacksec / droneci.json
Created September 20, 2016 13:23 — forked from dcoxall/droneci.json
Cloudformation template to deploy drone to AWS using EC2 Container Service
{
"Description": "Drone Continuous Integration (drone.io)",
"Parameters": {
"VPC": {
"Type": "AWS::EC2::VPC::Id",
"Description": "The VPC that needs provisioning"
},
"Subnets": {
"Type": "List<AWS::EC2::Subnet::Id>",
@bburky
bburky / coursera.sh
Last active June 30, 2016 17:30
Automatically configure a VM download Coursera courses
#!/bin/bash
# Automatically configure a VM download Coursera courses.
# This script works as a user data file for use with a cloud VM.
# This script will resume downloading if the VM is restarted.
# This script works with Debian jessie (or possibly Ubuntu with systemd).
# You must enroll in each course and accept the Honor of Code of each course
# before you can download them.
@danidiaz
danidiaz / _FP reading lists.md
Last active May 23, 2024 04:02
assorted reading lists

A series of reading lists mostly related to functional programming.

import System.Directory
import System.Environment
import System.FilePath
import Control.Applicative ((<$>))
import Control.Arrow (first, second)
import Control.Monad (void)
import Data.Either (rights)
import Data.List (isSuffixOf)
import Data.Set (Set, (\\), empty, fromList, insert, singleton, toList, union)
import Text.Parsec
@morbusg
morbusg / Unicode math in plain TeX
Created March 6, 2014 12:36
Some Unicode math glyph definitions for use with plain XeTeX using a token list approach instead of family changes.
\Umathcharnumdef\aleph="2135 \Umathcharnumdef\hbar="210F
\Umathcharnumdef\imath="1D6A4 \Umathcharnumdef\jmath="1D6A5
\Umathcharnumdef\ell="2113 \Umathcharnumdef\wp="2118 \Umathcharnumdef\Re="211C
\Umathcharnumdef\Im="2111 \Umathcharnumdef\infty="221E
\Umathcharnumdef\prime="2032 \Umathcharnumdef\emptyset="2205
\Umathcharnumdef\surd="221A \Umathcharnumdef\top="22A4
\Umathcharnumdef\bot="22A5 \Umathcharnumdef\|="2016
\Umathcharnumdef\angle="2220 \Umathcharnumdef\triangle="2206
\Umathcharnumdef\backslash="005C \Umathcharnumdef\forall="2200
\Umathcharnumdef\exists="2203 \Umathcharnumdef\neg="00AC
@creationix
creationix / jsonparse.js
Last active May 10, 2024 14:36
A streaming JSON parser as an embeddable state machine.
// A streaming byte oriented JSON parser. Feed it a single byte at a time and
// it will emit complete objects as it comes across them. Whitespace within and
// between objects is ignored. This means it can parse newline delimited JSON.
function jsonMachine(emit, next) {
next = next || $value;
return $value;
function $value(byte) {
if (!byte) return;
if (byte === 0x09 || byte === 0x0a || byte === 0x0d || byte === 0x20) {