Skip to content

Instantly share code, notes, and snippets.

View piq9117's full-sized avatar
💀
Nothing good is happening here

piq9117 piq9117

💀
Nothing good is happening here
View GitHub Profile
@mjlbach
mjlbach / gccEmacs.md
Last active December 6, 2023 10:34
Installing gccEmacs (native-comp) with Nix

WARNING: THIS GIST IS OUT OF DATE AND NO LONGER RELEVANT

  • Native-comp was enabled by default in nixpgks
  • Pgtk is not enabled by default, for that you can either override the derivation or use emacsPgtk from the nix-community emacs overlay if you don't want to build it yourself

Nix

Adding the overlay and configuring cachix

@i-am-tom
i-am-tom / FizzBuzz.hs
Last active June 26, 2023 16:35
Arguably the fastest implementation of FizzBuzz ever written.
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE UndecidableInstances #-}
{-# LANGUAGE UnsaturatedTypeFamilies #-}
import GHC.TypeLits
import Prelude hiding (Functor, Semigroup)
type Main = (Fizz <> Buzz) <$> (0 `To` 100)
@boreycutts
boreycutts / i3-gaps_installation_guide.md
Last active January 30, 2024 19:05
A simple installation guide for i3-gaps

Installing i3-gaps

Dependencies

i3-gaps has some packages that are required for it to work so install these things:

sudo apt install libxcb1-dev libxcb-keysyms1-dev libpango1.0-dev libxcb-util0-dev libxcb-icccm4-dev libyajl-dev libstartup-notification0-dev libxcb-randr0-dev libev-dev libxcb-cursor-dev libxcb-xinerama0-dev libxcb-xkb-dev libxkbcommon-dev libxkbcommon-x11-dev autoconf xutils-dev libtool automake

You also need to install libxcb-xrm-dev, but I got Unable to locate package libxcb-xrm-dev when trying to install from the apt repositories on Ubuntu 16.04. If this happens to you, just install it from source using these commands:

mkdir tmp
@joom
joom / lambda-cube.tex
Created April 14, 2018 02:03
Barendregt's lambda cube in tikzcd, with labels on arrows
\documentclass{standalone}
\usepackage{tikz-cd}
\usepackage{amsmath}
\usepackage{tgpagella}
\begin{document}
\begin{tikzcd}
& & \lambda\omega \arrow[rrr] & & & \lambda\Pi\omega \\
& & & & & \\
\lambda 2 \arrow[rruu] \arrow[rrr] & & & \lambda\Pi 2 \arrow[rruu] & & \\
@hallettj
hallettj / HKT.js
Last active June 27, 2019 15:19
Concept for emulating higher-kinded types in Flow via type-level functions
/*
* Concept for emulating higher-kinded types using Flow. Instead of passing
* a type that has not been applied to parameters, this pattern passes
* a type-level function that will map a parameter type to the desired
* higher-kinded type applied to the given parameter.
*
* @flow
*/
// a higher-kinded type is represented indirectly via a type-level function from
@busypeoples
busypeoples / PhantomTypeReasonML.md
Last active February 6, 2024 21:29
Phantom types in ReasonML

Phantom types in ReasonML

Introduction

"A phantom type is a parametrised type whose parameters do not all appear on the right-hand side of its definition..." Haskell Wiki, PhantomType

The following write-up is intended as an introduction into using phantom types in ReasonML.

Taking a look at the above definition from the Haskell wiki, it states that phantom types are parametrised types where not all parameters appear on the right-hand side. Let's try to see if we can implement a similar example as in said wiki.

@Avaq
Avaq / dangerous-promises.js
Last active October 12, 2021 04:13
Dangerous Promises
//
// utils
//
const thrush = x => f => f(x);
const indexBy = k => xs => xs.reduce((index, x) => {
if(index[x[k]] != null) index[x[k]].push(x);
else index[x[k]] = [x];
return index;
@justinwoo
justinwoo / purescript-reactive-programming-notes.md
Last active March 30, 2021 14:01
Purescript Reactive Programming options

Here are some of the examples of Reactive Programming libraries I've found in Purescript and what I've thought about them so far:

I've never used a library with truly continuous Behaviors, so this was really neat to try out for me. Really nice to use and comes with utilities for working with browser events already, and gives you good Event modules for picking your sampling options as necessary.

I will probably use this library for all of my future uses.

// install @types/react-redux and other nonsense
import * as React from 'react'
import { connect } from 'react-redux'
import { YourActualAppState } from './wherever-it-is.ts'
export function mapStateToProps({
whatever
}: YourActualAppState) {
return {
src/
app/ (application root component)
index.ts (most components use this pattern of an index.ts, style.css, and template.html)
style.css
template.html
entry/ (different entrypoints)
dev/
main.ts (main file for JIT mode)
module.ts
prod/