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 / iris_plot_ly.R
Created September 16, 2016 18:51
iris plotting with custom plotly mimetype
layout = list(
scene=list(
xaxis=list(title="sepal length [cm]"),
yaxis=list(title="sepal width [cm]"),
zaxis=list(title="petal length [cm]")
),
title="Iris dataset"
)
data = list(
@rgbkrk
rgbkrk / rx-on.js
Created September 10, 2016 01:32
Put Rx on any random page
var RxScript = document.createElement('script'); RxScript.src = "https://unpkg.com/@reactivex/rxjs/dist/global/Rx.js"; document.getElementsByTagName('head')[0].appendChild(RxScript);
@rgbkrk
rgbkrk / gist:044d1f16cd09a10d586c76de7ebcd452
Created August 4, 2016 20:41
ASCII Art and Emoji Collection
ಠ_ಠ
¯\_(ツ)_/¯
@rgbkrk
rgbkrk / npm-shrinkwrap.json
Created July 23, 2016 18:55
nteract/nteract shrinkwrap of the day
{
"name": "nteract",
"version": "0.0.4",
"dependencies": {
"abab": {
"version": "1.0.3",
"from": "abab@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/abab/-/abab-1.0.3.tgz"
},
"abbrev": {
@rgbkrk
rgbkrk / ipython_notebook_config.py
Last active July 20, 2016 20:36
notebook config for cross origin
c = get_config()
c.NotebookApp.ip='*'
c.NotebookApp.port = 8888
c.NotebookApp.open_browser = False
# Allow any set of ports, used below with localhost
port_digits = '(?::\d{1,5})?'
pat = '^(?:' + '|'.join([
# Allow localhost on all ports to use, regardless of HTTP vs HTTPS
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@rgbkrk
rgbkrk / console.js
Last active March 12, 2016 20:54
Tinkering with v8
function Console() {
}
Console.prototype.log = function() {
print(...arguments);
}
Console.prototype.error = function() {
print(...arguments);
}
const completeRequest = createMessage(sessionID, 'complete_request');
completeRequest.content = {
code: linePartial,
cursor_pos: linePartial.length,
};
shell.filter(isChildMessage.bind(completeRequest))
.filter(msg => msg.header.msg_type === 'complete_reply')
.subscribe(whatever...)
@rgbkrk
rgbkrk / ReduX.js
Last active January 16, 2016 18:54
Redux in RxJS
function store(action) {
return makeReducerStream(action)
.scan((state, reducer) => reducer(state), initialState)
.shareReplay(1);
}
@rgbkrk
rgbkrk / watkernel.js
Last active January 13, 2016 06:26
Getting kernel info using enchannel-zmq-backend
/*
* Retrieves kernel info, given a connection file
*
* node index.js /Users/rgbkrk/Library/Jupyter/runtime/kernel-24468.json
*
*/
const enchant = require('enchannel-zmq-backend');
const uuid = require('uuid');