This file contains hidden or 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 request = require("request") | |
var parseBuoyData(buoyid, cb) { | |
request(buoyURL(buoyid), function(e, r, b) { | |
if (e) { | |
throw new Error(e) | |
} | |
// do all that insane parsing nonsense here |
This file contains hidden or 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
exports.listLogs = function(req, res) { | |
SurfSession.find() | |
.populate('location') | |
.run(function(err, log) { | |
Wave.find(function(err, waves) { | |
var surfHeight = SurfSession.schema.path('surfHeight').enumValues; | |
var surfConditions = SurfSession.schema.path('surfConditions').enumValues; | |
var surfStoke = new SurfSession().generateStoke(); | |
var currentYear = moment().year(); | |
var surfSessionsThisYear = 0; |
This file contains hidden or 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 base64 | |
import hashlib | |
import hmac | |
import jsonlib2 | |
import requests | |
import sys | |
import time | |
class SynapseLoginException(Exception): |
This file contains hidden or 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
# Generate passwords of length suitable for typing with just your left hand. | |
import os, random, string | |
length = 10 | |
chars = "12345qwertasdfgzxcvQWERT!@#$%ASDFGZXCV" | |
random.seed = (os.urandom(1024)) | |
print ''.join(random.choice(chars) for i in range(length)) |
This file contains hidden or 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 json | |
import logging | |
from google.appengine.ext import db | |
from google.appengine.api import users | |
import webapp2 | |
# With routes like: | |
#app = webapp2.WSGIApplication([ | |
# webapp2.Route("/d/<collection>", DataHandler, methods=["GET", "POST"]), | |
# webapp2.Route("/d/<collection>/<id>", DataHandler, methods=["GET", "PUT", "DELETE"]), |
This file contains hidden or 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
# thanks @craigcitro | |
import collections | |
import itertools | |
RGB = collections.namedtuple('RGB', ['r', 'g', 'b']) | |
def rgb_to_str(rgb): | |
return "%02x%02x%02x" % (rgb.r, rgb.g, rgb.b) | |
This file contains hidden or 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
<link rel="import" href="../core-icon-button/core-icon-button.html"> | |
<link rel="import" href="../core-toolbar/core-toolbar.html"> | |
<link rel="import" href="../core-header-panel/core-header-panel.html"> | |
<polymer-element name="my-element"> | |
<template> | |
<style> | |
:host { | |
position: absolute; |
This file contains hidden or 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
# /usr/local/google/home/rtp/github/graphd.teeler/test/unit/BUILD:2:5 | |
sh_test( | |
name = "zeroguid", | |
data = ["//test/unit:zeroguid.sh", "//test/unit:rungraphd", "//graphd:graphd", "//util:gpush", "//test/unit:bigconf.conf", "//test/unit:cost2.broken.conf", "//test/unit:cost2.conf", "//test/unit:cost2.short.broken.conf", "//test/unit:cost2.short.conf", "//test/unit:david_1.conf", "//test/unit:david_4.conf", "//test/unit:dbname.broken.conf", "//test/unit:dbname.conf", "//test/unit:instance-id.conf", "//test/unit:logrotate.conf", "//test/unit:override-dir-1.conf", "//test/unit:override-dir-2.conf", "//test/unit:spewrequest.conf", "//test/unit:sync.conf", "//test/unit:zeroguid.out.exp"], | |
srcs = ["//test/unit:test.sh"], | |
args = ["-v", "zeroguid.sh"], | |
) | |
# /usr/local/google/home/rtp/github/graphd.teeler/test/unit/BUILD:2:5 | |
sh_test( |
This file contains hidden or 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
<!-- Creator : groff version 1.19.2 --> | |
<!-- CreationDate: Fri Sep 14 10:51:19 2018 --> | |
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" | |
"http://www.w3.org/TR/html4/loose.dtd"> | |
<html> | |
<head> | |
<meta name="generator" content="groff -Thtml, see www.gnu.org"> | |
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII"> | |
<meta name="Content-Style" content="text/css"> | |
<style type="text/css"> |
This file contains hidden or 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
Graphd testing | |
First build it: | |
{•̃_•̃} bazel build graphd | |
Then, run it: | |
{•̃_•̃} bazel-bin/graphd/graphd -d /tmp/some-tmp-db -y | |
graphd> write (name="human" value="chris" |