Skip to content

Instantly share code, notes, and snippets.

View leebyron's full-sized avatar
🌎

Lee Byron leebyron

🌎
View GitHub Profile
Options +FollowSymlinks
RewriteEngine on
# No intersticial for direct reference and self-reference
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http(s)?://box.leebyron.com/.*$ [NC]
# Add a line item for every website you don't need an intersticial for
# I've added my own website, gmail and facebook
RewriteCond %{HTTP_REFERER} !^http(s)?://([^\.]*.)?leebyron.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http(s)?://mail.google.com/.*$ [NC]
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;
@leebyron
leebyron / latlong.pde
Created May 29, 2011 03:50
conversions from Lat/long to 2d map projections - for Processing
/**
* A collection of functions responsible for performing translations between
* longitude/latitude coordinates and points on a 1/1 square
* (which you could then map to pixelspace)
*
* @author leebyron
*/
/**
* lon double x coordinate in radians [-PI,PI)
@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
@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 / 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 / index.js
Last active August 29, 2015 14:07
Immutable vs transducers.js (operation only)
var Benchmark = require('benchmark');
var t = require('transducers.js');
var Immutable = require('immutable');
var suite = Benchmark.Suite('transducers');
function benchArray(n) {
var arr = new Immutable.Range(0, n).toVector();
var transform = t.compose(
t.map(function(x) { return x + 10; }),
@leebyron
leebyron / index.js
Last active August 29, 2015 14:07
Immutable vs transducers.js (inline)
var Benchmark = require('benchmark');
var t = require('transducers.js');
var Immutable = require('immutable');
var suite = Benchmark.Suite('transducers');
function benchArray(n) {
var arr = new Immutable.Range(0, n).toVector();
suite
.add('Immutable map/filter (' + n + ')', function() {
@leebyron
leebyron / geocode
Created October 14, 2014 21:50
Simple geocoder
class Geocoder{
// google maps api key
String apiKey;
Geocoder(String apiKey){
this.apiKey = apiKey;
}
double[] locate(String location){
@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);