Skip to content

Instantly share code, notes, and snippets.

View rsbohn's full-sized avatar

Randall Bohn rsbohn

  • Rando Media
  • Orem Utah USA
View GitHub Profile
@rsbohn
rsbohn / guia
Created February 9, 2014 14:59
vlog ideas
* Build a light thing with a neopixel (prob ring) in a deep frame with frosted glass
** Explain how to frost the glass with sandpaper - Moh scale!
* Put a USB micro power connector (pigtails) on a breadboard
* Put a USB micro socket on a breadboard (permaproto)
* Measure your USB wall wart - does it really provide 2A regulated?
** How to safely draw 2A
** Math! Hfe, Vds, etc.
** Use an FET. N channel or P?
** Measure with a DVM or with an Arduino.
* Put a 6 pin ISP header on a permaproto. Cut some traces!
@rsbohn
rsbohn / get_current_obs.js
Created June 23, 2014 13:34
Get current observations from Weather Underground.
var http = require("http");
var api_key = "YOUR_KEY_HERE";
var report = function(location) {
http.get("http://api.wunderground.com"
+ "/api/" + api_key
+ "/conditions/q/" + location + ".json",
function (res) {
var all = "";
res.on("data", function (part) {
@rsbohn
rsbohn / Vagrantfile
Created July 31, 2014 20:19
vagrant runs docker runs progrium/nginx
Vagrant.configure("2") do |config|
config.vm.define "nginx" do |app|
app.vm.provider "docker" do |d|
d.image = "progrium/nginx"
d.name = "nginx"
# expose container ports to docker host
# access from the vagrant host is left
# as an exercise for the reader
d.ports = ["4880:80","4881:9000"]
@rsbohn
rsbohn / Dockerfile
Created August 11, 2014 13:00
nodewiki in a container
# container for xiti
## currently we use nodewiki but expect that to change
## see package.json
FROM ubuntu
RUN apt-get update
RUN apt-get install -y python-software-properties
RUN add-apt-repository ppa:chris-lea/node.js
RUN echo "deb http://us.archive.ubuntu.com/ubuntu/ precise universe" >> /etc/apt/sources.list
@rsbohn
rsbohn / callme
Last active August 29, 2015 14:05
How to run the current file in the Acme editor
#!/usr/local/plan9/bin/rc
bash `{9p read acme/$winid/tag | awk '{print $1}'}
@rsbohn
rsbohn / F5
Created August 15, 2014 20:19
acme editor: insert the current date at the top of the file
#!/usr/local/plan9/bin/rc
echo -n 0 | 9p write acme/$winid/addr
date | sed a\\n | 9p write acme/$winid/data
echo -n '1/^/' | 9p write acme/$winid/addr
echo -n 'dot=addr' | 9p write acme/$winid/ctl
@rsbohn
rsbohn / boot.html
Last active August 29, 2015 14:05
Quick-n-dirty editor for browser localStorage
<div id='tag' contenteditable='true'>boot</div>
<textArea id='B'>
var Xput = function() {
localStorage[tag.textContent] = B.value;
}
var Xget = function() {
B.value = localStorage[tag.textContent];
}
var Xopen = function(name) {
tag.textContent = name;
@rsbohn
rsbohn / gist.rb
Last active August 29, 2015 14:05
xiki gist menu
# save to ~/menu
# then run using "gist"
require "rest-client"
require "json"
class Gist
Github = RestClient::Resource.new "https://api.github.com"
DefaultMenu =
" - bb1f4fffaccbd30125b9
- user/rsbohn/
@rsbohn
rsbohn / wunderground.rb
Last active August 29, 2015 14:05
xiki calls Wunderground.com API
require "json"
require "rest-client"
class Wunderground
KEY = "YOUR-KEY-HERE"
WU = RestClient::Resource.new "http://api.wunderground.com/api/#{KEY}"
Sample = "- 02134/\n- AZ/Wikieup/\n- KSGU/\n- FL/Saint_Petersburg/\n- pws:KFLSTPET42/\n"
def self.menu *args
return Sample if args == []
@rsbohn
rsbohn / Dockerfile
Last active August 29, 2015 14:06 — forked from anonymous/Dockerfile
# container for remotestorage
# docker build -t remotestorage:latest https://gist.githubusercontent.com/rsbohn/f2106a47868f84d23519/raw/71bb980230a511d0a1924a84dbfee447d8f758d5/Dockerfile
# docker run -d -p 8001:8001 -p 8002:8002 remotestorage:latest
FROM ubuntu
RUN apt-get update
RUN apt-get install -y python-software-properties
RUN add-apt-repository ppa:chris-lea/node.js
RUN echo "deb http://us.archive.ubuntu.com/ubuntu/ precise universe" >> /etc/apt/sources.list