Skip to content

Instantly share code, notes, and snippets.

View rgbkrk's full-sized avatar
🌎
Think globally, act locally

Kyle Kelley rgbkrk

🌎
Think globally, act locally
View GitHub Profile
@rgbkrk
rgbkrk / color-chat.ipynb
Last active October 15, 2023 17:54
Generating colors with Chatlab via GPT-3.5
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@rgbkrk
rgbkrk / Cleaning Up Empty Notebooks.ipynb
Created November 16, 2017 18:08
Cleaning Up Empty Notebooks
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@rgbkrk
rgbkrk / ipythonji.ipynb
Created May 17, 2022 16:57
IPythonJI - Emoji for IPython
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@rgbkrk
rgbkrk / hubdecrypt.sh
Last active April 6, 2022 02:55
Encrypt a (short) file using someone's public key from github
#!/usr/bin/env bash
# HubCrypt
# ========
#
# Decrypt a file encrypted using hubencrypt (ok, it's just openssl + rsautl +
# your SSH keys). It needs the private key that matches your last public key
# listed at github.com/<user>.keys
#
@rgbkrk
rgbkrk / pyrax_install.ps1
Last active April 2, 2022 22:11
Powershell installation of python and pyrax on a fresh Rackspace Windows Server instance
##
## NOTE: This script is a walkthrough and may not work if run directly.
##
## If downloaded to run, make sure to set
##
## Set-ExecutionPolicy RemoteSigned
##
# Create a downloader via .NET
$notwget = New-Object System.Net.WebClient
@rgbkrk
rgbkrk / sql-mixin.md
Last active January 24, 2022 22:56
Turning lodash into declarative SQL

Lodash has a sweet feature called a mixin that lets you alias function names. Below here I alias names that we're used to using in SQL to (roughly) equivalent functions in lodash.

_.mixin({
  select: _.map,
  from: _.chain,
  where: _.filter,
  groupBy: _.sortByOrder,
})
@rgbkrk
rgbkrk / baby-names-2020.sql
Last active December 28, 2021 21:03
baby names
DROP TABLE IF EXISTS baby_names;
CREATE TEMPORARY TABLE baby_names( name TEXT, rank INTEGER );
-- From most popular baby names of 2020 according to the Social Security Administration
-- https://www.ssa.gov/oact/babynames/
INSERT INTO baby_names ('name', 'rank') VALUES ('Liam', 1);
INSERT INTO baby_names ('name', 'rank') VALUES ('Olivia', 1);
INSERT INTO baby_names ('name', 'rank') VALUES ('Noah', 2);
INSERT INTO baby_names ('name', 'rank') VALUES ('Emma', 2);
INSERT INTO baby_names ('name', 'rank') VALUES ('Oliver', 3);
@rgbkrk
rgbkrk / compare_notebooks.ipynb
Created November 14, 2020 00:34
comparing notebooks
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@rgbkrk
rgbkrk / notes.md
Last active August 30, 2018 22:23
Threading Weirdness with IPython kernels

Background

System:

  • Debian, running on Amazong
  • /root is backed by NFS (Amazon's EFS)

Launch jupyter console --kernel python3 in one terminal, then pstree in another.

@rgbkrk
rgbkrk / README.md
Last active May 27, 2018 14:13
kernel tinkering

Jupyter Kernels and Node

This is a (lightly) annotated run through of launching a jupyter kernel, sending some messages, and cleaning it up.

git clone https://gist.github.com/3239c1547b53c97cc648d5abb3cbe3e0.git kernely
cd kernely
npm install
node index.js