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
Loading
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@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
Loading
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
@rgbkrk
rgbkrk / Cleaning Up Empty Notebooks.ipynb
Created November 16, 2017 18:08
Cleaning Up Empty Notebooks
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@rgbkrk
rgbkrk / notebook.save.js
Last active June 30, 2017 20:19
Saving a notebook when the jupyter server won't allow it (e.g. Request Entity Too Large)
(function(console){
console.save = function(data, filename){
if(!data) {
data = Jupyter.notebook.toJSON();
}
filename = Jupyter.notebook.notebook_name;
if(!filename) {
@rgbkrk
rgbkrk / notebook-require-usage.md
Last active June 1, 2017 07:49
What are notebooks requiring?

nteract doesn't support requirejs because we have the builtin require at our fingertips. Jupyter notebook however has long operated under the assumption that you can use the builtin requirejs for loading modules asynchronously:

require(['d3'], function(d3) {...

I started exploring the idea of providing some of these modules in a "quirks" sort of mode where we provide limited access to "requirejs" while still sandboxed. To find out what modules were commonly required, I turned to Google BigQuery, the GitHub dataset, and a User Defined Function (UDF) written in JavaScript.

I'll flesh out this gist or a blog post later. For now, I'll just provide my query code:

@rgbkrk
rgbkrk / big_query_examples.md
Created May 25, 2017 18:45 — forked from arfon/big_query_examples.md
BigQuery Examples for blog post

How many times shouldn't it happen...

-- https://news.ycombinator.com/item?id=11396045

SELECT count(*)
FROM (SELECT id, repo_name, path
        FROM [bigquery-public-data:github_repos.sample_files]
 ) AS F