Skip to content

Instantly share code, notes, and snippets.

View omundy's full-sized avatar

Owen Mundy omundy

View GitHub Profile
<!doctype html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Bootstrap CSS -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-eOJMYsd53ii+scO/bJGFsiCZc+5NDVN2yr8+0RDqr0Ql0h+rP48ckxlpbzKgwra6" crossorigin="anonymous">
@omundy
omundy / index.html
Created October 30, 2017 13:11
A Simple d3 Network Graph
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<script src="http://d3js.org/d3.v2.min.js?2.9.3"></script>
<style>
.link {
stroke: #aaa;
}
@omundy
omundy / convert_to_csv.php
Last active October 25, 2017 13:04
Convert a Google Takeout JSON file to CSV table format
<?php
/**
* Convert a Google Takeout JSON file to CSV table format
* @author Owen Mundy owenmundy.com
* Note: Make sure PHP has enough memory allotted on your system to handle large strings
* Instructions:
* 1. Download PHP file and place next to your JSON file
* 2. Rename string pointing to your data file
* 3. On command line run $ php index.php
@omundy
omundy / NLTK POS Tagging.ipynb
Created December 10, 2016 14:34
NLTK POS Smell Tagging Examples
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
/**
* Simple animation to illustrate Processing.org HD video export using FFmpeg
* See this post for complete details
* http://owenmundy.com/blog/2013/01/use-processing-and-ffmpeg-to-export-hd-video/
* 2013 Owen Mundy owenmundy.com
*/
float xtheta = 0.0;
float ytheta = 0.0;
import os
cmd = 'raspistill -n -t 2000'
cmd += time.strftime(" -o /home/pi/python_scripts/py-picam/images/p_%Y%m%d_%H%M%S") +'.jpg'
os.system(cmd)
@omundy
omundy / fb_rank_bookmarklet
Last active December 28, 2015 03:39
How Facebook ranks all your friends bookmarklet (modified from Arjun Sreedharan's)
javascript: (function () {
function creator(e, t, n) {
var r = document.createElement(n);
var att = document.createAttribute("style");
att.value = "max-width:120px";
r.setAttributeNode(att);
var i = document.createTextNode(t);
r.appendChild(i);
e.appendChild(r);
}
@omundy
omundy / analog-read-all.js
Created May 26, 2012 13:52
Use bonescript and node.js to read from all analog pins on a BeagleBone
/*
* analog-read-all.js
* Use bonescript and node.js to read from all analog pins on a BeagleBone
* Found in the wild:
* https://groups.google.com/forum/#!msg/beagleboard/rftH6aqyR5k/n7jQbCNAL3YJ
*/
var bb = require('./bonescript');
var sys = require('util');
var fs = require('fs');
@omundy
omundy / analog-test-all-pins.py
Created May 17, 2012 15:10
Print reading from each analog-in pin on a BeagleBone using mrBBIO
# analog-test-all-pins.py - Owen Mundy
# Print reading from each analog-in pin on a BeagleBone
# with a short delay between each
# using mrBBIO by Matt Richardson:
# https://github.com/mrichardson23/mrBBIO
# This example is in the public domain
from mrbbio import *
def setup():
@omundy
omundy / analog-test-all-pins.py
Created May 17, 2012 12:46
BeagleBone test and print all analog-in pins
# analog-test-all-pins.py - Owen Mundy
# Print reading from each analog-in pin on a BeagleBone
# with a short delay between each
# This example is in the public domain
import os,time
i = 1
while(True):
os.system("cat /sys/bus/platform/devices/tsc/ain" + str(i))