Skip to content

Instantly share code, notes, and snippets.

@CMCDragonkai
CMCDragonkai / nixos_arduino_connection.md
Last active August 24, 2023 10:00
NixOS: Arduino Connection

Arduino Connection on NixOS

First we need lsusb command from the usbutils package.

> nix-env -i usbutils
> lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 011: ID 0403:6001 FTDI FT232 USB-Serial (UART) IC
@Icelandjack
Icelandjack / Constraints.org
Last active April 2, 2024 20:22
Type Classes and Constraints

Reddit discussion.

Disclaimer 1: Type classes are great but they are not the right tool for every job. Enjoy some balance and balance to your balance.

Disclaimer 2: I should tidy this up but probably won’t.

Disclaimer 3: Yeah called it, better to be realistic.

Type classes are a language of their own, this is an attempt to document features and give a name to them.

@karpathy
karpathy / pg-pong.py
Created May 30, 2016 22:50
Training a Neural Network ATARI Pong agent with Policy Gradients from raw pixels
""" Trains an agent with (stochastic) Policy Gradients on Pong. Uses OpenAI Gym. """
import numpy as np
import cPickle as pickle
import gym
# hyperparameters
H = 200 # number of hidden layer neurons
batch_size = 10 # every how many episodes to do a param update?
learning_rate = 1e-4
gamma = 0.99 # discount factor for reward
@sebz
sebz / grunt-hugo-lunrjs.md
Last active April 29, 2024 16:44
hugo + gruntjs + lunrjs = <3 search
@chrisdone
chrisdone / typing.md
Last active May 9, 2024 15:27
Typing Haskell in Haskell

Typing Haskell in Haskell

MARK P. JONES

Pacific Software Research Center

Department of Computer Science and Engineering

Oregon Graduate Institute of Science and Technology

@sjoerdvisscher
sjoerdvisscher / adjointFoldPlain.hs
Last active July 26, 2023 13:04
Adjoint folds, using regular Category from base (but custom Functor)
-- http://www.cs.ox.ac.uk/ralf.hinze/SSGIP10/AdjointFolds.pdf
-- http://www.cs.ox.ac.uk/ralf.hinze/publications/SCP-78-11.pdf
-- https://www.cs.ox.ac.uk/people/nicolas.wu/papers/URS.pdf
-- https://arxiv.org/pdf/2202.13633.pdf
{-# LANGUAGE
MultiParamTypeClasses
, FunctionalDependencies
, GADTs
, PolyKinds
module Printf
%default total
data Format = FInt Format -- %d
| FString Format -- %s
| FOther Char Format -- [a-zA-Z0-9]
| FEnd --
format : List Char -> Format
@pascalpoitras
pascalpoitras / config.md
Last active June 6, 2024 13:09
My WeeChat configuration

WeeChat Screenshot

Mouse


enable


@sjoerdvisscher
sjoerdvisscher / updatemonad.hs
Created May 8, 2013 09:21
The update monad which generalizes the reader, writer and state monad from http://homepages.inf.ed.ac.uk/s1225336/talks/types13.pdf
{-# LANGUAGE TypeSynonymInstances, FlexibleInstances, MultiParamTypeClasses #-}
import Data.Monoid
import Data.Monoid.Action
import Data.Monoid.MList (SM(..))
import Control.Monad.Trans.Class
newtype UpdateT p s m a = UpdateT { runUpdateT :: s -> m (p, a) }
@ekmett
ekmett / ekmett_conf.log
Created April 1, 2013 04:30
#haskell-lens log from ekmett_conf
[00:24] fumieval (~fumieval@124x39x126x66.ap124.ftth.ucom.ne.jp) joined the channel.
[00:25] nushio3 (7c277e42@gateway/web/freenode/ip.124.39.126.66) joined the channel.
[00:25] nushio3: hi there!
[00:26] edwardk: hello, hello!
[00:27] hiratara (~hiratara@h223020.dynamic.ppp.asahi-net.or.jp) joined the channel.
[00:27] fumieval: hi
[00:28] carter: hello everyone! Wait, is this the presentation room now?
[00:30] edwardk: Yep
[00:30] carter: enjoy!
[00:30] tanakh_ (~tanakh@124x39x126x66.ap124.ftth.ucom.ne.jp) joined the channel.