Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env python
"""Wraps EXE to use keyring to fetch the password securely."""
import os
import subprocess
import sys
import keyring
@rgardner
rgardner / random_row.sql
Created May 30, 2021 12:22
SQL get random row
SELECT * FROM table ORDER BY RANDOM() LIMIT 1;
@rgardner
rgardner / wsl.md
Created August 29, 2016 06:51
Install WSL in Windows 10

Install WSL in Windows 10

Windows Subsystem for Linux allows you to run Linux programs in Windows!

Instructions

  1. Activate Developer Mode in Settings -> Update & Security -> For developers
  2. Enable Windows Subsystem for Linux (Beta) in Control Panel -> Programs -> Turn Windows Features On or Off
from datetime import datetime
import enum
from infoaggexperiment.database import db
import random
from sqlalchemy.ext.hybrid import hybrid_property
import uuid
NO_FEEDBACK_GROUP = 1

Keybase proof

I hereby claim:

  • I am rgardner on github.
  • I am rgardner (https://keybase.io/rgardner) on keybase.
  • I have a public key ASALpuW4S5oaAJH3lGFORN4tQ8G0_0bl3-TH549PiAQG2wo

To claim this, I am signing this object:

from collections import namedtuple
from geopy import Point, distance
API_KEY = 'AIzaSyCeo86HIGUtpWaPOpOA6pbNQhHDe3-26ko'
MAX_STEPS = 5
FROM = (40.728833, -74.000852)
TO = (40.735012, -73.979333)
MOCKED_WAYPOINTS = [((40.72223320000001, -73.9874291), 4),
((40.7324849, -74.00259299999999), 7),
import urllib, json
from kmeans import kmean
AUTH_KEY = 'AIzaSyAG0fCOK8Qh9iODUjcK2TexVWVEBcw3MO4'
def FindRestaurants(origin, destination, newDirection=None):
jsonData = FindDir(origin, destination)
if (jsonData == "No Walking Path Found"):
print(jsonData)
@rgardner
rgardner / route.py
Last active January 31, 2016 08:22
from collections import namedtuple
import requests
from geopy import Point, distance
from typing import List, Tuple
API_KEY = 'AIzaSyCeo86HIGUtpWaPOpOA6pbNQhHDe3-26ko'
MAX_STEPS = 5
FROM = (40.728833, -74.000852)
TO = (40.735012, -73.979333)
{% extends "layout.html" %}
{% block title %}Period #{{ period.period_num }}{% endblock %}
{% block head %}
{{ super() }}
<style type="text/css">
.hidden {
display: none;
}
</style>
{% endblock %}