Skip to content

Instantly share code, notes, and snippets.

View k0emt's full-sized avatar

Bryan Nehl k0emt

View GitHub Profile
<!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";
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"]})
@k0emt
k0emt / README.md
Created May 26, 2016 21:14
Brushable Radial Chart

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

@k0emt
k0emt / color-cycle-progress.markdown
Created July 27, 2016 12:09
color cycle progress
@k0emt
k0emt / bubble-progress.markdown
Last active July 27, 2016 12:12
bubble progress
@k0emt
k0emt / create_replica_set.bat
Last active November 20, 2016 18:16
Helper batch file for starting up a replica set named m101. Drop the --logpath option if you want to enjoy the log text flying by in the console. The --oplogSize option is the magic sauce to avoid creation of numerous 512MB+ files up to 5% of disk space.
mkdir \data\rs1 \data\rs2 \data\rs3
start mongod --replSet m101 --logpath "1.log" --dbpath \data\rs1 --port 27017 --smallfiles --oplogSize 64
start mongod --replSet m101 --logpath "2.log" --dbpath \data\rs2 --port 27018 --smallfiles --oplogSize 64
start mongod --replSet m101 --logpath "3.log" --dbpath \data\rs3 --port 27019 --smallfiles --oplogSize 64
@k0emt
k0emt / Surface-rebuild.md
Last active September 7, 2017 03:37
Check list of software that goes onto surface tablet or PC -- data science / developer tools.

Chocolately Managed / Installed software

  • Chocolately
  • Git
  • NodeJS
  • yarn
  • Chrome x64
    • postman
  • MongoDB
  • InkScape
@k0emt
k0emt / Enron_to_Mongo.py
Last active April 26, 2018 04:05
Convert the Enron email dataset files to a MongoDB. Blog post here: http://soloso.blogspot.com/2011/07/getting-enron-mail-database-into.html Brendan McAdams @rit created a version of the code which utilizes the Python email library to produce a database with more metadata. You can see the results of his work here: http://mongodb-enron-email.s3-w…
import os
import datetime
from pymongo import MongoClient
__author__ = 'k0emt'
MAIL_DIR_PATH = '/Users/k0emt/Projects/enron/enron_mail_20110402/maildir'
PREFIX_TRIM_AMOUNT = len(MAIL_DIR_PATH) + 1
MAX_USER_RUN_LIMIT = 50
MAX_USER_EMAILS_PER_FOLDER_FILE_LIMIT = 2
counter = 1
@k0emt
k0emt / updating_docs.py
Last active August 14, 2019 20:51
This gist shows how to loop throw and alter/update an individual uniquely identified document.
from pymongo import MongoClient
import sys
# code example to show updating individual records in a loop
# initialize the database with:
# mongoimport -d school -c scores --type json grades.js
# verify no records with "added"
# db.scores.find({"added":{$exists:true}}) // returns nothing
@k0emt
k0emt / sony-f15-pop-os-build-notes.md
Last active September 7, 2019 22:57
Notes regarding setting up a Pop OS! development environment on a Sony Flip 15.

Sony Flip 15 Pop OS! build

Pop OS!

Had to turn off secure boot and switch from UEFI to legacy to install. Use ASSIST above keyboard for boot options and getting into CMOS.

keyboard shortcuts

ctrl-shift-c and ctrl-shift-v for copy and paste in the terminal