Skip to content

Instantly share code, notes, and snippets.

View leebyron's full-sized avatar
🌎

Lee Byron leebyron

🌎
View GitHub Profile
@leebyron
leebyron / .flowconfig
Last active July 9, 2018 04:13
flow-implements-bug
We couldn’t find that file to show.
declare function Record(): any
const RecordInstance = Record({
})
class _Foo extends RecordInstance {}
exports.Foo = _Foo
@leebyron
leebyron / Gradient2D.pde
Last active August 23, 2017 20:09
Solar relative position math from Solar Calendar.
class Gradient2D{
PImage source;
Gradient2D(String src){
source = loadImage(src);
}
color get(float g1, float g2){
int x = constrain( floor( g1*source.width ), 0, source.width-1);
@leebyron
leebyron / index.js
Last active August 8, 2017 18:53
requirebin sketch
const Observable = require("zen-observable");
let sink;
const list = [];
const error = new Error();
new Observable(_sink => {
sink = _sink;
return () => list.push('cleanup');
}).subscribe({

Keybase proof

I hereby claim:

  • I am leebyron on github.
  • I am leeb (https://keybase.io/leeb) on keybase.
  • I have a public key ASBnVuESLbEjmR4Ac79vgbgOLVoPtA6GAZSV-MxsHpJ1_Ao

To claim this, I am signing this object:

@leebyron
leebyron / gist:5818233
Created June 19, 2013 21:27
React logo SVG
<svg version="1.1" width="184px" height="166px" viewBox="0 0 184 166">
<g transform="translate(92 83)">
<circle fill="#fff" r="16" />
<g fill="none" stroke="#fff" stroke-width="8">
<ellipse rx="84" ry="32" />
<ellipse rx="84" ry="32" transform="rotate(120)" />
<ellipse rx="84" ry="32" transform="rotate(60)" />
</g>
</g>
</svg>
@leebyron
leebyron / maybeFilter.js
Last active June 29, 2016 08:34
An array filter function which does not create a new array if no items are removed.
function maybeFilter(array, predicate) {
var newArray;
array.forEach((item, i) => {
if (predicate(item)) {
if (newArray) {
newArray.push(item)
}
} else if (!newArray) {
newArray = array.slice(0, i)
}
@leebyron
leebyron / gist:1213423
Created September 13, 2011 08:41
Sorted Events
diff --git a/html/js/javelin/core/Event.js b/html/js/javelin/core/Event.js
index 94df448..0848521 100644
--- a/html/js/javelin/core/Event.js
+++ b/html/js/javelin/core/Event.js
@@ -267,7 +267,12 @@ JX.install('Event', {
/**
* @task info
*/
- nodes : {}
+ nodes : {},
@leebyron
leebyron / Example Use
Created June 14, 2011 23:20
innernets
- (void)applicationWillFinishLaunching:(NSNotification *)aNotification
{
// check for future network connectivity changes
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(updateNetStatus:)
name:kNetConnectionChangeNotification
object:[NetConnection netConnection]];
}
- (void)updateNetStatus:(NSNotification *)notif
String make = columns[0];
int id = int(columns[4]);
String model = columns[1];
int year = int(columns[2]);
String trim = columns[5];
int trade_in_value_excellent = 0;
int trade_in_value_good = 0;
int trade_in_value_fair = 0;
int private_party_value_excellent = 0;