Skip to content

Instantly share code, notes, and snippets.

View ryaninvents's full-sized avatar

Ryan Kennedy ryaninvents

View GitHub Profile
@ryaninvents
ryaninvents / index.html
Created April 23, 2015 13:53
Creating an offer with RTCPeerConnection
<!DOCTYPE html>
<html>
<head>
<script src="//code.jquery.com/jquery-2.1.1.min.js"></script>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
<h1>Creating an offer using <a href="https://github.com/otalk/RTCPeerConnection">RTCPeerConnection</a></h1>
<pre></pre>
@ryaninvents
ryaninvents / README.md
Created June 20, 2015 21:15
Generator functions and promises

A quick demonstration of how Promises work with generator functions in ES6.

$ npm i
$ node_modules/.bin/babel-node promise-test.js

Output:

imaGenerator started
@ryaninvents
ryaninvents / fix-npm.sh
Last active March 26, 2016 16:33
Fix npm global install
# This script is the **correct** way to allow installation and use
# of npm executables without sudo.
# Declare where you want your global packages installed to.
npm config set prefix '~/.local/share/npm'
# Ensure the directory exists.
mkdir -p ~/.local/share/npm
# Change `.zshrc` to `.bashrc` if appropriate, but consider instead
@ryaninvents
ryaninvents / README.md
Last active August 29, 2015 14:24
Hipsteroku name generator

Generates hipster-ish Heroku-style names.

tattooed-skateboard-3254

try-hard-wolf-3343

pop-up-cronut-4510

heirloom-mimosa-3946

@ryaninvents
ryaninvents / README.md
Created July 15, 2015 11:35
Pad function

I write a pad function fairly often, and I've never been so satisfied with an implementation as I am with this one.

@ryaninvents
ryaninvents / keyplate.scad
Created October 16, 2015 15:13
Keyboard switch plate
// mounting plate thickness
THICKNESS = 1.4*2;
// measured from Gateron switch and DSA keycap
SWITCH_WIDTH = 14;
SWITCH_LIP_WIDTH = 15.65;
SWITCH_LIP_THICKNESS = 0.95;
SWITCH_CLIP_WIDTH = 3.8;
SWITCH_CLIP_GAP = 1.4;
SWITCH_CLIP_DEPTH = 0.7;
@ryaninvents
ryaninvents / keybase.md
Created October 26, 2015 19:04
keybase.md

Keybase proof

I hereby claim:

  • I am r24y on github.
  • I am r24y (https://keybase.io/r24y) on keybase.
  • I have a public key whose fingerprint is 30A3 701F A5BC ECA0 1CB4 83FE 78E2 5EF9 C8C9 76C8

To claim this, I am signing this object:

@ryaninvents
ryaninvents / caffeine.js
Last active November 3, 2015 15:36
Blood caffeine concentration
var duration = 24*3600*1000; // 24 hours as milliseconds
var halfLife = 5*3600*1000; // 5 hours as milliseconds
var absorpLife = 3600*1000; // 1 hour as milliseconds
var end = +(new Date());
var start = end - duration;
var numSteps = 24*60;
var step = duration/numSteps;
var startVal = 106;
var rows = [];
var log2 = Math.log(2);
@ryaninvents
ryaninvents / client.describe.json
Created December 9, 2015 22:11
Node SOAP client.describe
{
"ExchangeServices": {
"ExchangeServicePort": {
"ResolveNames": {
"input": "m:ResolveNamesType",
"output": "m:ResolveNamesResponseType"
},
"ExpandDL": {
"input": "m:ExpandDLType",
"output": "m:ExpandDLResponseType"
@ryaninvents
ryaninvents / README.md
Last active January 25, 2016 15:10 — forked from mbostock/.block
Solar Terminator