Skip to content

Instantly share code, notes, and snippets.

View JonathanReeve's full-sized avatar

Jonathan Reeve JonathanReeve

View GitHub Profile
@JonathanReeve
JonathanReeve / errors.txt
Created May 21, 2020 01:27
Errors when running nix-shell
(imported from Control.Monad.Trans.Error):
Deprecated: "Use Control.Monad.Trans.Except instead"
|
242 | x <- E.runErrorT (f (E.runErrorT m))
| ^^^^^^^^^^^
src/Control/Monad/Morph.hs:242:30: warning: [-Wdeprecations]
In the use of ‘runErrorT’
(imported from Control.Monad.Trans.Error):
Deprecated: "Use Control.Monad.Trans.Except instead"
name hex n parent parentHex
0 dust #b2996e 3 orange #FFA500
1 tea #65ab7c 16 grey #BEBEBE
2 spruce #0a5f38 1 black #000000
3 desert #ccad60 6 orange #FFA500
4 swamp #698339 2 grey #BEBEBE
5 fern #63a950 1 green #00FF00
6 straw #fcf679 9 yellow #FFFF00
7 leather #ac7434 5 orange #FFA500
8 hazel #8e7618 2 orange #FFA500
import pandas as pd
csv = ",name,hex,n,parent,parentHex\n0,dust,#b2996e,3,orange,#FFA500\n1,tea,#65ab7c,16,grey,#BEBEBE\n2,spruce,#0a5f38,1,black,#000000\n3,desert,#ccad60,6,orange,#FFA500\n4,swamp,#698339,2,grey,#BEBEBE\n5,fern,#63a950,1,green,#00FF00\n6,straw,#fcf679,9,yellow,#FFFF00\n7,leather,#ac7434,5,orange,#FFA500\n8,hazel,#8e7618,2,orange,#FFA500\n9,ice,#d6fffa,4,white,#FFFFFF\n"
df = pd.read_csv(csv)
df
@JonathanReeve
JonathanReeve / requirements.nix
Created January 5, 2020 16:27
pypi2nix output for colormath
# generated using pypi2nix tool (version: 2.0.2)
# See more at: https://github.com/nix-community/pypi2nix
#
# COMMAND:
# pypi2nix -V python3 -e colormath
#
{ pkgs ? import <nixpkgs> {},
overrides ? ({ pkgs, python }: self: super: {})
}:
@JonathanReeve
JonathanReeve / exercises-analysis.ipynb
Created September 8, 2019 19:44
Exercises in Style Analysis
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
with import <nixpkgs> {};
(let
my_jupyterlab = python37.pkgs.buildPythonPackage rec {
pname = "jupyterlab";
version = "1.0.4";
src = python37.pkgs.fetchPypi {
inherit pname version;
sha256 = "0vhdbzrphirl3x37d4zh0gaxhs6f7wj0i30wy4878yjkmlr219rj";
#Musicians or singers that have a genre containing 'rock'
SELECT DISTINCT ?human ?humanLabel
WHERE
{
VALUES ?professions {wd:Q177220 wd:Q639669}
?human wdt:P31 wd:Q5 .
?human wdt:P106 ?professions .
?human wikibase:statements ?statementcount .
?human wdt:P1303 wd:Q128309 .
FILTER (?statementcount > 10 ) .
sudo su
mount /dev/nvme0n1p5 /mnt
mount /dev/nvme0n1p1 /mnt/boot/efi
mount -t proc proc /mnt/proc
mount -t sysfs sys /mnt/sys
mount -o bind /dev /mnt/dev
mount -t devpts pts /mnt/dev/pts/
pacman -Sy
pacman -S efibootmgr gosfstools grub
modprobe efivarfs
@JonathanReeve
JonathanReeve / data-wrangling.py
Created June 7, 2019 16:40
Getting data from a COPAC XML record
recordsList = parsedXml['modsCollection']['mods']
years = []
for record in recordsList:
originList = record['originInfo']
for origin in originList:
if 'dateIssued' in origin:
years.append(origin['dateIssued'])
@JonathanReeve
JonathanReeve / dhsi-twitter-bot.py
Created June 5, 2019 14:57
The Twitter Bot "Alternate DHSIs," which finds DHSI initialisms from Project Gutenberg texts.
import re
import requests
import json
import time
import tweepy
from secrets import *
# This requires that you have a file, secrets.py
# Which contains the keys below.