Skip to content

Instantly share code, notes, and snippets.

View silky's full-sized avatar

Noon van der Silk silky

View GitHub Profile
# a simple dashboard for the waveshare 2in7b screen
# to be ran inside: https://github.com/waveshare/e-Paper/tree/master/RaspberryPi%26JetsonNano/python/examples
# 1. install the latest versions of `pyowm` and `requests`
# 2. edit `OPEN_WEATHER_KEY`, `LOCATION`, and `NEWS_API_KEY`
import sys
import os
picdir = os.path.join(os.path.dirname(os.path.dirname(os.path.realpath(__file__))), 'pic')
libdir = os.path.join(os.path.dirname(os.path.dirname(os.path.realpath(__file__))), 'lib')
if os.path.exists(libdir):
@silky
silky / linear_diophantine.py
Created January 21, 2020 21:44 — forked from pjt33/linear_diophantine.py
Count solutions to linear Diophantine equations
from collections import Counter
from fractions import Fraction
def _gcd(a, b):
while a:
a, b = b % a, a
return b
{-# LANGUAGE TupleSections #-}
module Main where
import Graphics.Gloss
import Graphics.Gloss.Raster.Field
import System.Random
import Data.Semigroup
import GHC.Base (NonEmpty(..))
{-# LANGUAGE TupleSections #-}
module Main where
import Graphics.Gloss
import Graphics.Gloss.Raster.Field
import System.Random
import Data.Semigroup
import GHC.Base (NonEmpty(..))
@silky
silky / gc.c
Created November 15, 2019 05:26 — forked from sordina/gc.c
Implementation of Baby's first Garbage Collector from http://journal.stuffwithstuff.com/2013/12/08/babys-first-garbage-collector
// http://journal.stuffwithstuff.com/2013/12/08/babys-first-garbage-collector/
//
#define STACK_MAX 256
#define INITIAL_GC_THRESHOLD 2
#include <stdio.h>
#include <stdlib.h>
void gc(); // Pre-Declared for co-recursive usage
@silky
silky / streamlit_prodigy.py
Created October 3, 2019 22:24 — forked from ines/streamlit_prodigy.py
Streamlit + Prodigy
"""
Example of a Streamlit app for an interactive Prodigy dataset viewer that also lets you
run simple training experiments for NER and text classification.
Requires the Prodigy annotation tool to be installed: https://prodi.gy
See here for details on Streamlit: https://streamlit.io.
"""
import streamlit as st
from prodigy.components.db import connect
from prodigy.models.ner import EntityRecognizer, merge_spans, guess_batch_size
@silky
silky / streamlit_prodigy.py
Created October 3, 2019 22:24 — forked from ines/streamlit_prodigy.py
Streamlit + Prodigy
"""
Example of a Streamlit app for an interactive Prodigy dataset viewer that also lets you
run simple training experiments for NER and text classification.
Requires the Prodigy annotation tool to be installed: https://prodi.gy
See here for details on Streamlit: https://streamlit.io.
"""
import streamlit as st
from prodigy.components.db import connect
from prodigy.models.ner import EntityRecognizer, merge_spans, guess_batch_size
@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