Skip to content

Instantly share code, notes, and snippets.

@gatlin
gatlin / typed-racket-monads.md
Last active September 24, 2024 16:43
A simple definition and demonstration of monads in Typed Racket

What the fuck is a monad?

Or: functor? I 'ardly know 'er!

Monads are difficult to explain without sounding either patronizing or condescending: I would sound patronizing if I came up with some facile analogy and I would be condescending to describe it categorically.

Instead, I'll frame a problem and piece-by-piece solve the problem with what will turn out to be a monad.

  • update system
    sudo yum update
  • install xmonad, xmonad-contrib, xmobar
    sudo yum install xmonad ghc-xmonad-contrib{,-devel} xmobar
  • install cabal-install, for yeganesh
@andrevdm
andrevdm / rigolCsvAdc.fsx
Last active June 2, 2016 23:13
F# "logic" parser for rigol oscilloscope CSV files, outputs hex values. Interprets analogue data as 3 state (i.e. two data "lines" on a single channel)
open System
open System.IO
open System.Text
open System.Globalization
open System.Text.RegularExpressions
let l1 = 1.0
let l2 = 2.0
let ttlTrue = 2.3
@paf31
paf31 / 24days.md
Last active August 8, 2023 05:53
24 Days of PureScript

This blog post series has moved here.

You might also be interested in the 2016 version.

@myusuf3
myusuf3 / delete_git_submodule.md
Created November 3, 2014 17:36
How effectively delete a git submodule.

To remove a submodule you need to:

  • Delete the relevant section from the .gitmodules file.
  • Stage the .gitmodules changes git add .gitmodules
  • Delete the relevant section from .git/config.
  • Run git rm --cached path_to_submodule (no trailing slash).
  • Run rm -rf .git/modules/path_to_submodule (no trailing slash).
  • Commit git commit -m "Removed submodule "
  • Delete the now untracked submodule files rm -rf path_to_submodule
@rtt
rtt / gist:5a2e0cfa638c938cca59
Created August 14, 2014 09:46
example python tinderbot
# encoding: utf8 1,1 Top# encoding: utf8
import argparse
from datetime import datetime
import json
from random import randint
import requests
import sys
from time import sleep
@JulienPalard
JulienPalard / curry.py
Created August 1, 2014 10:51
KISS Python curry
#!/usr/bin/env python
def curry(func):
"""
Decorator to curry a function, typical usage:
>>> @curry
... def foo(a, b, c):
... return a + b + c
@TikhonJelvis
TikhonJelvis / viz.hs
Last active September 22, 2016 06:05
Generating graphs for my Quora answer
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE QuasiQuotes #-}
import qualified Data.Graph.Inductive as Graph
import Data.Graph.Inductive (Gr, match, matchAny)
import Data.String.Interpolation (str)
complex :: Gr () ()
complex = Graph.mkGraph nodes edges
where nodes = [(x, ()) | x <- [1..10]]
@rtt
rtt / tinder-api-documentation.md
Last active June 15, 2025 18:01
Tinder API Documentation

Tinder API documentation

Note: this was written in April/May 2014 and the API may has definitely changed since. I have nothing to do with Tinder, nor its API, and I do not offer any support for anything you may build on top of this. Proceed with caution

http://rsty.org/

I've sniffed most of the Tinder API to see how it works. You can use this to create bots (etc) very trivially. Some example python bot code is here -> https://gist.github.com/rtt/5a2e0cfa638c938cca59 (horribly quick and dirty, you've been warned!)

@tomerfiliba
tomerfiliba / construct++.cpp
Created February 25, 2014 19:54
Consturct++: Pickler combinators in C++11
#include <iostream>
#include <sstream>
#include <cstdint>
#include <cstddef>
#include <string>
#include <memory>
#include <vector>
#include <tuple>
#include <utility>
#include <type_traits>