Skip to content

Instantly share code, notes, and snippets.

Avatar
👨‍💻
hackerman

dalan dalanmiller

👨‍💻
hackerman
View GitHub Profile
@dalanmiller
dalanmiller / grab-flickr-links.js
Last active Dec 2, 2018
Console snippet to grab all Flickr Data export links
View grab-flickr-links.js
@dalanmiller
dalanmiller / Dockerfile.app
Last active Jun 29, 2020
RethinkDB docker-compose.yml example
View Dockerfile.app
IMAGE node:argon
RUN mkdir -p /usr/app
COPY . /usr/app
WORKDIR /usr/app
RUN npm install
View CPU-20160721T145919.cpuprofile
{"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
View get_all_secondary_filter_example.js
// Creating an index that returns true or false based on if certain property is > 0
r.db("example").table("example").indexCreate("example_index", (row) => { return row('above_zero').gt(0) })
// Only returns true values
r.db("example").table("example").getAll( true , {index: "above_zero"})
// Only returns false values
r.db("example").table("example").getAll( false , {index: "above_zero"})
View gist:4cb4d1354419182d50dfdd602e402202
Verifying that +dalanmiller is my blockchain ID. https://onename.com/dalanmiller
@dalanmiller
dalanmiller / asyncio-changefeeds.py
Created May 2, 2016
asyncio & RethinkDB changefeeds example
View asyncio-changefeeds.py
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():
View netbeez-install.sh
#!/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
@dalanmiller
dalanmiller / Dockerfile
Created Dec 16, 2015
jekyll deploy dockerfile
View 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
View feed.rss
<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
<title>RethinkDB: the open-source database for the realtime web</title>
<description>News and updates from the RethinkDB team.</description>
<link>http://rethinkdb.com</link>
<atom:link href="http://rethinkdb.com/feed.xml" rel="self" type="application/rss+xml" />
<item>
View rethinkdb_statistical_reql_query_examples.js
##
#Finding the hottest observations per day (or a _single_ maxima for each day)
##
r.db("telemetry_pi").table("observations").create_index
r.db('telemetry_pi').table("observations").group({index: "datetime"}).max("temp").ungroup()("reduction")
##
#Finding some basic statistics and calculating a simple linear regression (y_humidity = alpha + beta_temp * temp)
##
# https://en.wikipedia.org/wiki/Simple_linear_regression
You can’t perform that action at this time.