Skip to content

Instantly share code, notes, and snippets.

📓
Literally a notebook

Kyle Kelley rgbkrk

📓
Literally a notebook
Block or report user

Report or block rgbkrk

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@rgbkrk
rgbkrk / notes.md
Last active Aug 30, 2018
Threading Weirdness with IPython kernels
View notes.md

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
kernel tinkering
View README.md

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
View Cleaning Up Empty Notebooks.ipynb
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 Jun 30, 2017
Saving a notebook when the jupyter server won't allow it (e.g. Request Entity Too Large)
View notebook.save.js
(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 Jun 1, 2017
What are notebooks requiring?
View notebook-require-usage.md

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 — forked from arfon/big_query_examples.md
BigQuery Examples for blog post
View big_query_examples.md

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
@rgbkrk
rgbkrk / random_image.py
Last active May 24, 2017
Query giphy for random images
View random_image.py
import IPython.display
import requests
def random_image_url(tags=None):
query = ""
if tags is not None:
query = "&tag=" + "+".join(tags)
api_url = "http://api.giphy.com/v1/gifs/random?api_key=dc6zaTOxFJmzC" + query
resp = requests.get(api_url)
@rgbkrk
rgbkrk / javascript-proposal.ipynb
Last active Jul 27, 2017
Proposing some javascript bits
View javascript-proposal.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@rgbkrk
rgbkrk / table-with-schema.ipynb
Last active Sep 7, 2017
Using the new table schema with Pandas
View table-with-schema.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@rgbkrk
rgbkrk / dabblet.css
Created Jan 12, 2017 — forked from LeaVerou/dabblet.css
The cicada principle in animations
View dabblet.css
/**
* The cicada principle in animations
* Remember the cicada principle that used prime numbers to make multiple overlaid repeated backgrounds seem more random?
* There’s no reason it can’t be applied to repeating linear animations too (using primes for the durations, divided by 10)
*/
@keyframes spin { to { transform: rotate(1turn); } }
@keyframes radius { 50% { border-radius: 50%; } }
@keyframes color { 33% { color: rebeccapurple; } 66% { color: deeppink } }
@keyframes width { 50% { border-width: .3em; } }
You can’t perform that action at this time.