Skip to content

Instantly share code, notes, and snippets.

View silky's full-sized avatar

Noon van der Silk silky

View GitHub Profile
@silky
silky / Install
Created October 1, 2019 22:25 — forked from ines/Install
Streamlit + spaCy
pip install streamlit
pip install spacy
python -m spacy download en_core_web_sm
python -m spacy download en_core_web_md
python -m spacy download de_core_news_sm
@silky
silky / THLPE.hs
Created May 14, 2019 00:35 — forked from utdemir/THLPE.hs
Property Checking "The Hardest Logic Puzzle Ever"
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE MultiWayIf #-}
{-# LANGUAGE RecordWildCards #-}
module Game.THLPE
( THLPE ()
, GodAnswer (..)
, GodType (..)
, GodName (..)
@silky
silky / clean-up-boot-partition-ubuntu.md
Created December 22, 2018 02:31 — forked from ipbastola/clean-up-boot-partition-ubuntu.md
Safest way to clean up boot partition - Ubuntu 14.04LTS-x64, Ubuntu 16.04LTS-x64

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 August 22, 2018 23:43 — forked from johnhw/umap_sparse.py
1 million prime UMAP layout
### 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
#!/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 #-}
{-# 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 June 21, 2018 07:23
Script to bump sound using `amixer` from `alsa-utils`
#!/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 January 4, 2018 06:23 — forked from ErikAugust/spectre.c
Spectre example code
#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
{-# 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