Skip to content

Instantly share code, notes, and snippets.

Bryan Nehl k0emt

View GitHub Profile
View color-cycle-progress.markdown
@k0emt
k0emt / README.md
Created May 26, 2016
Brushable Radial Chart
View README.md

A modification of Susie Lu's radial weather plot. This one shows periods of cloudiness, precipitation and freezing temperatures via the bars around the border. It also includes a circular brush that lets you select a band on the radial chart. The selected band is then displayed in a more traditional linear way on the bottom left.

The original readme explains what's going on with the radial chart:

Weather Plot - New York 2015

In the example we're looking at historical weather data for New York provided by intellicast.com and wunderground.com. Inspired by weather-radicals.com.

This example uses scales to roll your own radial projection by mapping out the x, y, and r positions. If you are creating a line or an area you can use d3's convenience functions d3.svg.line.radial and d3.svg.area.radial but this is a m

View index.html
<!DOCTYPE html>
<html>
<head>
<link href='https://fonts.googleapis.com/css?family=Open+Sans+Condensed:300' rel='stylesheet' type='text/css'>
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.6/d3.min.js"></script>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<style>
.label {
font-size: 2em;
View mongodb_lookup.js
use lookup_experiment
db.items.insert({"name":"ink","price":5.55})
db.items.insert({"name":"pen","price":29.95,
"description": {"color":"purple", "manufacturer":"Lamy", "model": "Safari" }})
db.items.insert({"name":"paper","price":5.00})
db.items.insert({"name":"pencil","price":10.00})
db.orders.insert({_id:1, "customer":"inkguy","items":["ink","pen","paper"]})
db.orders.insert({_id:2, "customer":"pencilgal","items":["pencil","paper"]})
View svg_1600x900_monitor_pairings.html
<!DOCTYPE html>
<html>
<head>
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.6/d3.min.js"></script>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<style>
.label {
font-size: 10em;
font-family:"sans-serif";
@k0emt
k0emt / hello_world.tpl
Created Jun 24, 2013
Bottle example. The tpl file belongs in a views subdirectory.
View hello_world.tpl
%for thing in things:
<li>{{thing}}</li>
%end
@k0emt
k0emt / EnumStringExample.java
Created May 14, 2013
Example of working with enums in Java and in particular how to transform them into strings.
View EnumStringExample.java
public class EnumStringExample {
public static enum DAYS_OF_THE_WEEK {
MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, SUNDAY;
public String toString() {
String plainName = name().toString();
String fancy = plainName.charAt(0)
+ plainName.substring(1).toLowerCase();
@k0emt
k0emt / init_replica.js
Created May 14, 2013
Companion javascript to initialize MongoDB replica set.
View init_replica.js
config = { _id: "m101", members:[
{ _id : 0, host : "localhost:27017"},
{ _id : 1, host : "localhost:27018"},
{ _id : 2, host : "localhost:27019"} ]
};
rs.initiate(config);
rs.status();
@k0emt
k0emt / hello_world_bottle.py
Created Apr 6, 2013
Example of hello world in bottle with python
View hello_world_bottle.py
import bottle
@bottle.route('/')
def home_page():
return "Hello World\n"
@bottle.route('/testpage')
def test_page():
return "this is a test page"
You can’t perform that action at this time.