Skip to content

Instantly share code, notes, and snippets.

View cameron's full-sized avatar

Cameron Boehmer cameron

  • Empty Vessel
  • Portland, OR
  • 21:56 (UTC -07:00)
View GitHub Profile
var floatingButtonDirective = function() {
return {
restrict: 'AE',
scope: {
text: '@'
},
template: '<div class="floating-button">Text: {{ text }}</div>'
};
};
@cameron
cameron / example.py
Last active August 29, 2015 13:59
Digital Ocean API — Python Client
from triton import triton
def get_droplet():
droplets = triton.droplets()
if len(droplets):
return droplets[0]
return triton.droplets.new()
@cameron
cameron / add.html
Last active August 29, 2015 14:00 — forked from caged/README.md
<html>
<body>
<select class="startTemp">
</select>
<select class="endTemp">
</select>
<input type="submit" class="add" value="Add">
<a href='index.html'>Graph</a>
<script src="add.js"></script>
</body>
@cameron
cameron / gist:b88c5035d2822524ff2a
Created July 28, 2014 01:40
vagrant up/reload both fail to mount NFS with "mount.nfs: requested NFS version or transport protocol is not supported"
INFO global: Vagrant version: 1.6.3
INFO global: Ruby version: 2.0.0
INFO global: RubyGems version: 2.0.14
INFO global: VAGRANT_EXECUTABLE="/Applications/Vagrant/bin/../embedded/gems/gems/vagrant-1.6.3/bin/vagrant"
INFO global: VAGRANT_LOG="INFO"
INFO global: VAGRANT_INSTALLER_EMBEDDED_DIR="/Applications/Vagrant/bin/../embedded"
INFO global: VAGRANT_INSTALLER_VERSION="2"
INFO global: VAGRANT_DETECTED_OS="Darwin"
INFO global: VAGRANT_INSTALLER_ENV="1"
INFO global: VAGRANT_INTERNAL_BUNDLERIZED="1"
@cameron
cameron / deps.json
Last active August 29, 2015 14:05
ng-deps: the package manager manager
{
"searchOrder": ["path/to/libs", "bower", "npm", "CDNs"]
}
@cameron
cameron / hyperscope.js
Created August 30, 2014 00:54
angular's $scope extensions
// Hyperscope
// Upgrading $scope.$watch, making some new friends
angular.module('hyperscope', [])
// service for extending $scope objects
.factory('Hyperscope', function($parse, $rootScope){
var vanillaAdditions = {
@cameron
cameron / shell
Created September 4, 2014 06:01
using expect to automate shells and tests in docker containers
#! /usr/bin/expect -f
# ssh into the vagrant coreos machine
spawn ssh coreos
# find a prompt inside the vagrant vm
expect "*core@core*"
# get a shell inside the docker container
send "sudo nsenter --target \$(docker inspect --format '{{.State.Pid}}' \$(docker ps | grep dex_server:latest | awk '{print \$1}')) --mount --uts --ipc --net --pid\r"
@cameron
cameron / gist:94b1271d591f5f6281ec
Last active August 29, 2015 14:06
databacon example/test
import time
import random
import mummy
import databacon as db
# TODONT
db.connect({
'shards': [{
'shard': 0,
@cameron
cameron / output
Last active August 29, 2015 14:06
vagrant-1.6.5/lib/vagrant/util/network_ip.rb:14:in `&': nil can't be coerced into Fixnum (TypeError)
$ VAGRANT_LOG=info vagrant up --provider=virtualbox
INFO global: Vagrant version: 1.6.5
INFO global: Ruby version: 2.0.0
INFO global: RubyGems version: 2.0.14
INFO global: VAGRANT_EXECUTABLE="/Applications/Vagrant/bin/../embedded/gems/gems/vagrant-1.6.5/bin/vagrant"
INFO global: VAGRANT_LOG="info"
INFO global: VAGRANT_INSTALLER_EMBEDDED_DIR="/Applications/Vagrant/bin/../embedded"
INFO global: VAGRANT_INSTALLER_VERSION="2"
INFO global: VAGRANT_DETECTED_OS="Darwin"
INFO global: VAGRANT_INSTALLER_ENV="1"
@cameron
cameron / journalctl
Last active August 29, 2015 14:06
CoreOS bug: docker.service inactive/dead on boot in vagrant/vmware
-- Logs begin at Wed 2014-09-17 01:30:44 UTC, end at Wed 2014-09-17 01:40:14 UTC. --
Sep 17 01:30:44 localhost systemd-journal[87]: Runtime journal is using 6.2M (max allowed 49.9M, trying to leave 74.8M free of 492.8M available → current limit 49.9M).
Sep 17 01:30:44 localhost systemd-journal[87]: Runtime journal is using 6.2M (max allowed 49.9M, trying to leave 74.8M free of 492.8M available → current limit 49.9M).
Sep 17 01:30:44 localhost kernel: Initializing cgroup subsys cpuset
Sep 17 01:30:44 localhost kernel: Initializing cgroup subsys cpu
Sep 17 01:30:44 localhost kernel: Initializing cgroup subsys cpuacct
Sep 17 01:30:44 localhost kernel: Linux version 3.15.8+ (buildbot@ip-10-204-3-57) (gcc version 4.6.3 (Gentoo Hardened 4.6.3 p1.13, pie-0.5.2) ) #2 SMP Fri Aug 15 22:29:31 UTC 2014
Sep 17 01:30:44 localhost kernel: Command line: init=/usr/lib/systemd/systemd console=ttyS0,115200n8 console=tty0 ro noswap cros_legacy root=LABEL=ROOT rootflags=subvol=root usr=gptprio: usr=PARTUUID=7130c94a-213a-4e5a-8