Skip to content

Instantly share code, notes, and snippets.

Noon van der Silk silky

Block or report user

Report or block silky

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@silky
silky / THLPE.hs
Created May 14, 2019 — forked from utdemir/THLPE.hs
Property Checking "The Hardest Logic Puzzle Ever"
View THLPE.hs
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE MultiWayIf #-}
{-# LANGUAGE RecordWildCards #-}
module Game.THLPE
( THLPE ()
, GodAnswer (..)
, GodType (..)
, GodName (..)
@silky
silky / clean-up-boot-partition-ubuntu.md
Created Dec 22, 2018 — forked from ipbastola/clean-up-boot-partition-ubuntu.md
Safest way to clean up boot partition - Ubuntu 14.04LTS-x64, Ubuntu 16.04LTS-x64
View clean-up-boot-partition-ubuntu.md

Safest way to clean up boot partition - Ubuntu 14.04LTS-x64, Ubuntu 16.04LTS-x64

Reference

Case I: if /boot is not 100% full and apt is working

1. Check the current kernel version

$ uname -r 
@silky
silky / umap_sparse.py
Created Aug 22, 2018 — forked from johnhw/umap_sparse.py
1 million prime UMAP layout
View umap_sparse.py
### JHW 2018
import numpy as np
import umap
# This code from the excellent module at:
# https://stackoverflow.com/questions/4643647/fast-prime-factorization-module
import random
View Unsupervised.hs
#!/usr/bin/env stack
-- stack script --resolver lts-12.0
-- --package diagrams
-- --package diagrams-lib
-- --package diagrams-cairo
-- --package random
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE NoMonomorphismRestriction #-}
View Main.hs
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE NoMonomorphismRestriction #-}
{-# LANGUAGE ViewPatterns #-}
{-# LANGUAGE ScopedTypeVariables #-}
module Main where
import Diagrams.Prelude
import Diagrams.Backend.Cairo.CmdLine
@silky
silky / BumpSound.hs
Created Jun 21, 2018
Script to bump sound using `amixer` from `alsa-utils`
View BumpSound.hs
#!/usr/bin/env stack
-- stack script --resolver lts-8.12
-- --package turtle
-- --package string-conv
-- Compile like:
-- > stack exec --package turtle --package string-conv -- ghc --make BumpSound.hs
{-# LANGUAGE OverloadedStrings #-}
@silky
silky / spectre.c
Created Jan 4, 2018 — forked from ErikAugust/spectre.c
Spectre example code
View spectre.c
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#ifdef _MSC_VER
#include <intrin.h> /* for rdtscp and clflush */
#pragma optimize("gt",on)
#else
#include <x86intrin.h> /* for rdtscp and clflush */
#endif
View HaskellEqualityMatrix.hs
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE ScopedTypeVariables #-}
import Language.Haskell.Interpreter
import Text.InterpolatedString.Perl6
import Control.Exception
import Control.Monad
import Data.Traversable
format :: Either InterpreterError Bool -> String
View CalculusOfConstructions.hs
--Roughly based on https://github.com/Gabriel439/Haskell-Morte-Library/blob/master/src/Morte/Core.hs by Gabriel Gonzalez et al.
data Expr = Star | Box | Var Int | Lam Int Expr Expr | Pi Int Expr Expr | App Expr Expr deriving (Show, Eq)
subst v e (Var v') | v == v' = e
subst v e (Lam v' ta b ) | v == v' = Lam v' (subst v e ta) b
subst v e (Lam v' ta b ) = Lam v' (subst v e ta) (subst v e b )
subst v e (Pi v' ta tb) | v == v' = Pi v' (subst v e ta) tb
subst v e (Pi v' ta tb) = Pi v' (subst v e ta) (subst v e tb)
subst v e (App f a ) = App (subst v e f ) (subst v e a )
@silky
silky / char-rnn.hs
Created Nov 8, 2017 — forked from nurpax/char-rnn.hs
Some char-rnn generated Haskell based on training with the GHC HEAD source code
View char-rnn.hs
-- buildPatSynDetails, so this is a mempty, even the type
-- we generate the same location here.
hsConDeclDetails _ = pprPanic "tcLHsBindsCtOrigin" (ppr val_val_binds)
--------------------
zonkForeignCall :: FlexibleInfo -> CoreBind
-> Maybe FreeVars -- True <=> supplied EndBinds
-> RecFlag
-> Cts -> ForeignOpt Id
You can’t perform that action at this time.