Skip to content

Instantly share code, notes, and snippets.

View dalanmiller's full-sized avatar
👨‍💻

dalan dalanmiller

👨‍💻
View GitHub Profile
prefixes = 'JKLMNOPQ'
suffix = 'ack'
for letter in prefixes:
if letter == 'O' or 'Q':
print letter + 'u' + suffix
else:
print letter + suffix
@dalanmiller
dalanmiller / gist:4498422
Last active December 10, 2015 21:58
Simple flask app for printing HTTP data
from flask import Flask
app = Flask(__name__)
app.debug = True
@app.route("/")
def hello():
return "Hello World!"
@app.route('/test')
def test_webhook():
@dalanmiller
dalanmiller / Dockerfile
Created December 16, 2015 17:32
jekyll deploy dockerfile
FROM ruby:latest
RUN mkdir /root/.ssh/
RUN touch /root/.ssh/known_hosts
RUN ssh-keyscan -T 60 github.com >> /root/.ssh/known_hosts
COPY autodeploy /root/.ssh/
RUN curl -sL https://deb.nodesource.com/setup_5.x | bash -
RUN apt-get install --yes nodejs git

Keybase proof

I hereby claim:

  • I am dalanmiller on github.
  • I am dalanmiller (https://keybase.io/dalanmiller) on keybase.
  • I have a public key ASAQCRsgm5E5wH1wpGzk3IMIgHvgCmsVpKeFnqGR-hUE4Ao

To claim this, I am signing this object:

@dalanmiller
dalanmiller / netbeez-install.sh
Last active January 21, 2016 06:18
Netbeez install script is broken - https://netbeez.net/product/install-netbeez-software-agent/ - this is fixed.
#!/bin/sh
sudo echo deb http://repo.netbeez.net wheezy main >> /etc/apt/sources.list
sudo wget -O - http://repo.netbeez.net/netbeez_pub.key | sudo apt-key add -
sudo apt-get update
sudo apt-get install netbeez-agent
Verifying that +dalanmiller is my blockchain ID. https://onename.com/dalanmiller
{"head":{"functionName":"(root)","scriptId":"0","url":"","lineNumber":0,"columnNumber":0,"hitCount":0,"callUID":121,"children":[{"functionName":"(program)","scriptId":"0","url":"","lineNumber":0,"columnNumber":0,"hitCount":720,"callUID":1,"children":[],"deoptReason":"","id":2,"positionTicks":[]},{"functionName":"B.onmessage","scriptId":"9312","url":"http://localhost:8181/horizon/horizon.js","lineNumber":3,"columnNumber":9276,"hitCount":11,"callUID":78,"children":[{"functionName":"e.next","scriptId":"9312","url":"http://localhost:8181/horizon/horizon.js","lineNumber":2,"columnNumber":2541,"hitCount":1,"callUID":10,"children":[{"functionName":"e._next","scriptId":"9312","url":"http://localhost:8181/horizon/horizon.js","lineNumber":2,"columnNumber":2882,"hitCount":1,"callUID":9,"children":[{"functionName":"e.next","scriptId":"9312","url":"http://localhost:8181/horizon/horizon.js","lineNumber":2,"columnNumber":3500,"hitCount":2,"callUID":8,"children":[{"functionName":"e.__tryOrUnsub","scriptId":"9312","url":"http
@dalanmiller
dalanmiller / download_rethinkdb_for_raspberry_pi_2.sh
Last active September 19, 2016 10:30
A quick script to download and compile RethinkDB on Raspberry Pi 2
sudo apt-get install g++ protobuf-compiler libprotobuf-dev libboost-dev curl m4 wget
#At this point make sure you check to see that 2.0.4 is still the most recent version of RethinkDB! http://rethinkdb.com
wget http://download.rethinkdb.com/dist/rethinkdb-latest.tgz
tar xf rethinkdb-latest.tgz
rm rethinkdb-latest.tgz
cd rethinkdb-*
./configure --with-system-malloc --allow-fetch
#Export the proper C++ flags for Raspberry Pi 1/2
#!/usr/bin/python
import rethinkdb as r
from datetime import datetime, timedelta
conn = r.connect("localhost", 28015, db="telemetry_pi")
##
#Finding the average temperature & humidity for the past 24 hours
##
day_ago = datetime.now() - timedelta(hours=24)
cursor = r.table("observations")\
@dalanmiller
dalanmiller / asyncio-changefeeds.py
Created May 2, 2016 22:39
asyncio & RethinkDB changefeeds example
import rethinkdb as r
import asyncio
r.set_loop_type("asyncio")
async def get_connection():
return await r.connect("localhost", 28015)
async def changefeed_old():