Skip to content

Instantly share code, notes, and snippets.

View jboynyc's full-sized avatar
🍜

John Boy jboynyc

🍜
View GitHub Profile
@jboynyc
jboynyc / greet.lil
Created March 24, 2025 11:16
run a Lil script using a nix-shell shebang
#!/usr/bin/env nix-shell
#! nix-shell -p decker
#! nix-shell -i lilt
sys.seed:sys.ms
on greet do
greetings: insert exclamation object with
"Ciao" "bella"
"Hello" "world"
@jboynyc
jboynyc / greeter.scm
Created March 10, 2025 13:25
Guile Goblins script with Nix shebang
#!/usr/bin/env nix-shell
#! nix-shell -I nixpkgs=https://github.com/NixOS/nixpkgs/archive/refs/heads/nixos-unstable-small.tar.gz
#! nix-shell -p guile guile-fibers guile-gnutls guile-goblins
#! nix-shell -i "guile --no-auto-compile -s"
!#
(use-modules (goblins)
(goblins actor-lib methods))
(define a-vat (spawn-vat))
@jboynyc
jboynyc / rsa_keypair.py
Created November 22, 2024 23:53
RSA keypair in Python
#!/usr/bin/env nix-shell
#! nix-shell -i python3 -p "python3.withPackages (p: [ p.rsa ])"
from os import cpu_count
import rsa
(pub, priv) = rsa.newkeys(2048, poolsize=cpu_count())
@jboynyc
jboynyc / shell.nix
Created May 27, 2024 21:36
nix dev shell with raylib-guile
with import <nixpkgs> {};
let
raylib-version = "4.5.0";
raylib-api-xml = fetchurl {
url = "https://raw.githubusercontent.com/raysan5/raylib/${raylib-version}/parser/output/raylib_api.xml";
hash = "sha256-guPSduYmJ1ZUZO9B282I93RHFUhC2g0gZxy0j8RISTA=";
};
raylib-guile = stdenv.mkDerivation {
pname = "raylib-guile";
@jboynyc
jboynyc / update_models.py
Created February 9, 2023 15:28
update spacy models in nixpkgs
#!/usr/bin/env nix-shell
#! nix-shell -i python3 -p "python3.withPackages (p: with p; [sh tqdm])"
"""
Collect metadata on spaCy language models of a particular release to update the
models.json file in nixpkgs/pkgs/development/python-modules/spacy
Run this script in the meta dir of the spacy-models repository, providing the
desired release number as its only argument.
"""
@jboynyc
jboynyc / aamachine.nix
Last active March 7, 2024 22:09
nix derivation for Dialog
with import <nixpkgs> {};
let
aamachineSrc = fetchzip {
url = "https://hd0.linusakesson.net/files/aamachine-0.5.4.zip";
sha256 = "sha256-TDAwcNwGW4GMNv8e3VuKbNMSYLHDIQNlc4REQb+FRvw=";
};
aamachineVersion = "0.5.4";
in
stdenv.mkDerivation {
@jboynyc
jboynyc / Makefile
Last active October 28, 2022 20:36
sphinx + bib minimal example
# Minimal makefile for Sphinx documentation
#
# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = .
BUILDDIR = _build
We can make this file beautiful and searchable if this error is corrected: Unclosed quoted field in line 2.
"AwardNumber","Title","NSFOrganization","Program(s)","StartDate","LastAmendmentDate","PrincipalInvestigator","State","Organization","AwardInstrument","ProgramManager","EndDate","AwardedAmountToDate","Co-PIName(s)","PIEmailAddress","OrganizationStreet","OrganizationCity","OrganizationState","OrganizationZip","OrganizationPhone","NSFDirectorate","ProgramElementCode(s)","ProgramReferenceCode(s)","ARRAAmount","Abstract"
"2026631","RAPID: Real time monitoring of information consumption regarding the coronavirus","SES","AIB-Acctble Institutions&Behav, Decision, Risk & Mgmt Sci, Sociology, Methodology, Measuremt & Stats, Secure &Trustworthy Cyberspace","04/15/2020","04/06/2020","David Lazer","MA","Northeastern University","Standard Grant","Toby Parcel","03/31/2021","$200,000.00","Alessandro Vespignani, Briony Swire-Thompson","[email protected]","360 HUNTINGTON AVE","BOSTON","MA","021155005","6173733004","SBE","120Y, 1321, 1331, 1333, 8060","025Z, 065Z, 096Z, 7434, 7914, 9179","$0.00","The COVID-19 pandemic has highlig
@jboynyc
jboynyc / git-commits-graph.py
Created January 23, 2022 15:49
Create a bar chart showing monthly commits to a Git repository over time
import altair as alt
import pandas as pd
from pydriller import Repository
repo_dates = []
for commit in Repository('/path/to/repository').traverse_commits():
repo_dates.append(commit.committer_date)
d = pd.DataFrame(dict(commit_date=pd.to_datetime(repo_dates, utc=True), commits=1))
@jboynyc
jboynyc / weborf.nix
Created March 17, 2021 11:51
nix derivation for weborf
with import <nixpkgs> {};
let
name = "weborf";
version = "0.17";
in
stdenv.mkDerivation {
name = "${name}";
configureFlags = [ "prefix=${placeholder "out"}" ];