Skip to content

Instantly share code, notes, and snippets.

View duaneking's full-sized avatar
🏡
Working From Home. Code. Love. Defend.

Duane King duaneking

🏡
Working From Home. Code. Love. Defend.
View GitHub Profile
### Keybase proof
I hereby claim:
* I am duaneking on github.
* I am dfk (https://keybase.io/dfk) on keybase.
* I have a public key whose fingerprint is 9C92 9D9B 982A 9067 6057 FDED 3D39 F25A B4D7 CAF0
To claim this, I am signing this object:
@duaneking
duaneking / colorTempToRGB.js
Created July 5, 2016 01:05 — forked from paulkaplan/colorTempToRGB.js
Color Temperature to RGB
// From http://www.tannerhelland.com/4435/convert-temperature-rgb-algorithm-code/
// Start with a temperature, in Kelvin, somewhere between 1000 and 40000. (Other values may work,
// but I can't make any promises about the quality of the algorithm's estimates above 40000 K.)
function colorTemperatureToRGB(kelvin){
var temp = kelvin / 100;
<?php
require 'path-to-Stripe.php';
if ($_POST) {
Stripe::setApiKey("YOUR-API-KEY");
$error = '';
$success = '';
try {
if (!isset($_POST['stripeToken']))
throw new Exception("The Stripe Token was not generated correctly");
<?php
// minimal routing
function web_app($routes, $verb, $path) {
$verb = strtoupper($verb);
$path = trim(parse_url($path, PHP_URL_PATH), '/');
foreach ($routes as $route => $func) {
@list($req_verb, $req_path) = preg_split('/\s+/', $route, 2);

Latency numbers every programmer should know

L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns             
Compress 1K bytes with Zippy ............. 3,000 ns  =   3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns  =  20 µs
SSD random read ........................ 150,000 ns  = 150 µs

Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs

Ok so I was hoping tht pycharm would respect my virtialenv but apperently it did not.
Duanes-Air-4:crown Duane$ pip show cqlsh cqlengine six cassandra-driver
---
Name: cqlsh
Version: 4.1.1
Location: /Library/Python/2.7/site-packages
Requires: cql, simplejson, unittest2
---
public class Perlin {
public int repeat;
public Perlin(int repeat = -1) {
this.repeat = repeat;
}
public double OctavePerlin(double x, double y, double z, int octaves, double persistence) {
double total = 0;
/*!
*
* wavepot windchimes
* nondefault.net
*
*/
var transpose = 0;
var ct = 0;