This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## | |
#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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from collections import Counter | |
words = [] | |
with open("/usr/share/dict/words","r") as f: | |
for line in f: | |
words.append(line.strip()) | |
words_list = [] | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import re | |
import string | |
import random | |
path = "path_to_folder_just_about_set_of_text_files" | |
word = re.compile("\w*") | |
for x,y,z in os.walk(path): | |
for file in z: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pymongo | |
from pprint import pprint | |
mc = pymongo.MongoClient("localhost", 27017) | |
db = mc['yelp'] | |
doctor = db.businesses.find_one() | |
reviews_on_business = db.reviews.find({"business_id" : doctor["business_id"]}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import rethinkdb as r | |
url = "http://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/2.5_month.geojson" | |
def refresh_quakes(): | |
conn = r.connect() | |
r.db("earthquakes").table("quakes").insert( | |
r.http(url)["features"].merge({ | |
"time": r.epoch_time( | |
r.row['properties']['time'] / 1000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ssh -nNT -L port_on_local_machine:ip_of_docker_container_on_remote_host:port_of_docker_container_on_remote_host username@remote_host | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var r = require("rethinkdb"); | |
var Promise = require("bluebird"); | |
var fs = require("fs"); | |
var PushBullet = require('pushbullet'); | |
Promise.promisifyAll(fs); | |
fs.readFileAsync("token").then(function(val) { | |
PUSHER = new PushBullet(val.toString().trim()); | |
}) | |
.then(function(){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import socket | |
import rethinkdb as r | |
import time | |
import Adafruit_DHT | |
import datetime | |
import logging | |
import sys | |
logging.basicConfig( | |
level=logging.INFO, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git --version | |
pwd | |
git init project1 | |
ls -al | |
cd project1 | |
ls -al | |
open . | |
which git | |
OlderNewer