Skip to content

Instantly share code, notes, and snippets.

@dobbs
dobbs / Dockerfile
Last active May 14, 2018 22:05
npm info lifecycle [email protected]~build: Failed to exec build script
FROM node:8.5 as src
WORKDIR /usr/local/src
RUN git clone "https://github.com/OriginProtocol/demo-dapp.git" \
--branch master
RUN cd demo-dapp && npm install
RUN cd demo-dapp && npm run build
FROM abiosoft/caddy:0.11.0
COPY --from=src /usr/local/src/demo-dapp/build/ /srv
@dobbs
dobbs / btc-usd-5years.json
Last active February 3, 2018 22:37
Cache of bitcoin to USD prices
{"Response":"Success","Type":100,"Aggregated":false,"Data":[{"time":1359936000,"close":20.43,"high":21.05,"low":19.86,"open":20.59,"volumefrom":52219.14,"volumeto":1066570.21},{"time":1360022400,"close":20.6,"high":20.79,"low":20.2,"open":20.43,"volumefrom":29212.44,"volumeto":600949.67},{"time":1360108800,"close":21.18,"high":21.33,"low":20.6,"open":20.6,"volumefrom":51989.6,"volumeto":1096396.16},{"time":1360195200,"close":22.15,"high":22.22,"low":20.77,"open":21.18,"volumefrom":64263.77,"volumeto":1388465.81},{"time":1360281600,"close":22.66,"high":22.77,"low":22,"open":22.15,"volumefrom":48649.93,"volumeto":1090678.48},{"time":1360368000,"close":23.65,"high":23.99,"low":22.58,"open":22.66,"volumefrom":38133.01,"volumeto":886034.01},{"time":1360454400,"close":23.97,"high":24.11,"low":22.67,"open":23.65,"volumefrom":56426.07,"volumeto":1321513.68},{"time":1360540800,"close":24.65,"high":24.68,"low":23.65,"open":23.97,"volumefrom":29526.73,"volumeto":712458.7},{"time":1360627200,"close":25.17,"high":25.83,"l
@dobbs
dobbs / ipaddress
Last active December 4, 2016 22:40
just gimme the IP address already
#!/bin/bash
#
# /usr/local/sbin/ipaddress
usage() {
cat <<EOF
Usage: $(basename $0) [interface]
Report the IP 4 address for the default interface (or the one given in the params)
(default interface is computed from the default route)
@dobbs
dobbs / .COMMANDS.sh
Last active August 29, 2015 14:25
kitchen converge fails consistently first time through for chef-server on ubuntu-14.04
# I created a minimal wrapper around the chef-server cookbook
# with these commands. For your convenience I include in this gist the complete .kitchen.yml, metadata.rb, and recipies/default.rb
# You can see the output from 'kitchen converge' in the console.log also included in the gist.
# the kitchen log file is in an earlier revision of this gist:
# https://gist.githubusercontent.com/dobbs/1611a20cdb8232c76617/raw/28e99ec849ee3c42901db3a242f5917d8b78fcce/.kitchen%2520logs%2520default-ubuntu-1404.log
chef generate cookbook wrap-chef-server
cd wrap-chef-server
echo "depends 'chef-server', '~> 4.0.0'" >> metadata.rb
echo "include_recipe 'chef-server'" >> recipes/default.rb
ruby -pi -e 'gsub(/ubuntu-.*/, "ubuntu-14.04"); gsub(/^.*name: centos.*$/, "")' .kitchen.yml
@dobbs
dobbs / builder.rb
Last active August 29, 2015 14:12
Simple Abstraction for Builder objects in Ruby
class Builder < Struct
def self.with(spec, &block)
struct = new(*(spec.keys)) do
def initialize(options={})
super
options.each { |opt, value| self[opt] = value }
freeze
end
def with(options, &block)
@dobbs
dobbs / scratch.rb
Created December 10, 2014 15:32
PRY, Capybara, and Selenium for DOM REPL
require 'capybara'
Capybara.default_driver = :selenium
Capybara.javascript_driver = :selenium
Capybara.run_server = false
Capybara.app_host = 'http://localhost:3000'
class Scratch
include Capybara::DSL
@dobbs
dobbs / details.log
Last active August 29, 2015 14:08
go-server-14.2.0-377.deb checksums don't match (nor go-agent.deb, go-server.zip, go-agent.zip)
###### go-server.deb ###########################################################
$ curl -O http://download.go.cd/gocd-deb/go-server-14.2.0-377.deb
###### SHA1
$ echo "5f66e4effde11695f606270ea0eb27eb36226033 go-server-14.2.0-377.deb" | sha1sum -c -
go-server-14.2.0-377.deb: FAILED
sha1sum: WARNING: 1 computed checksum did NOT match
$ sha1sum go-server-14.2.0-377.deb
77da6bab514c386f4a41304ab9dc66504bf385b0 go-server-14.2.0-377.deb
@dobbs
dobbs / index.html
Last active August 29, 2015 14:06
Examples of d3 and SVG <foreignObject> that don't work right
<!DOCTYPE html>
<meta charset="utf-8">
<html>
<head>
<title>grids</title>
<script src="http://d3js.org/d3.v3.min.js" type="text/javascript"></script>
<style type="text/css">
svg {border: 1px solid #d0d0d0;}
</style>
</head>
@dobbs
dobbs / README.md
Last active August 29, 2015 14:05 — forked from mbostock/.block

Mouseover to repel nodes. Adapted from an adaptation of Mike Bostock's talk on force layouts.

Trying to get collision detection of rectangular objects.

@dobbs
dobbs / keybase.md
Created March 19, 2014 04:48
keybase.md

Keybase proof

I hereby claim:

  • I am dobbs on github.
  • I am dobbs (https://keybase.io/dobbs) on keybase.
  • I have a public key whose fingerprint is 1DC7 AB3B 74DE 8F9F 31D0 D1A9 5AC0 5EE0 DBBE B4CF

To claim this, I am signing this object: