Skip to content

Instantly share code, notes, and snippets.

View reedobrien's full-sized avatar

Reed O'Brien reedobrien

View GitHub Profile
[buildout]
extensions = mr.developer
parts =
gae_sdk
gae_tools
app_lib
local_appserver_deps
nosetests
# order matters so that this python overwrites the one generated by gae_tools
# until they publish the fix https://github.com/prmtl/appfy.recipe.gae/pull/9
package main
import (
"bufio"
"fmt"
"io"
"log"
"os"
"os/exec"
"strings"
package main
import (
"net/http"
"database/sql"
"fmt"
"log"
"os"
)
@reedobrien
reedobrien / dawg.py
Last active August 29, 2015 14:10 — forked from smhanov/dawg.py
#!/usr/bin/python3
# By Steve Hanov, 2011. Released to the public domain.
# Updated 2014 to use DAWG as a mapping.
import sys
import time
DICTIONARY = "/usr/share/dict/words"
QUERY = sys.argv[1:]
# This class represents a node in the directed acyclic word graph (DAWG). It
// Copyright 2015 Google Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
# This is a copy of the clang-format vim-integration script, refactored to work
# with yapf.
# Questions and/or suggestions? I'm @pignacio in github.
# This script is hosted at http://gist.github.com/pignacio/f93218bbafa2aa94610c
# I'm not sure if this works properly in windows/mac. Only tested in linux.
#
# This file is a minimal yapf vim-integration. To install:
# - Change 'binary' if yapf is not on the path (see below).
# - Add to your .vimrc:
#
@reedobrien
reedobrien / timecapsule-handler
Created December 15, 2015 22:23 — forked from dgraziotin/timecapsule-handler
Script to automatically look for Apple TimeCapsule devices and mount/umount them under GNU/Linux. See http://task3.cc/418/how-to-automatically-mount-and-umount-apple-time-capsule-on-linu for info and explanations.
#!/bin/bash
#
# This program is free software. It comes without any warranty, to
# the extent permitted by applicable law. You can redistribute it
# and/or modify it under the terms of the Do What The Fuck You Want
# To Public License, Version 2, as published by Sam Hocevar. See
# http://sam.zoy.org/wtfpl/COPYING for more details.
#
# Version 3, enhanced for Ubuntu 13.X+, Fedora 19+, and similar distros.
package main
// overview of crqs.go:
// this example app and supporting documentation enables you to query analytics data via the Core Reporting API in a completely headless manner, with
// no "popup" or user intervention required. it doesn't "handle" the returned data very well, as that will depend on what metrics/dimensions your
// query has. better handling of this is left as an exercise for the reader. :) follow the pre-reqs, change the ga* consts specific to your own app,
// and you should be good to go. uses google-api-go-client, analytics/v3, oauth, and oauth/jwt which you can download and install from
// https://code.google.com/p/goauth2/ and http://code.google.com/p/google-api-go-client/
// docs/pre-reqs:
@reedobrien
reedobrien / gist:7120663
Last active December 26, 2015 08:09 — forked from sanatgersappa/gist:4030649
SAML
package main
import (
"fmt"
"io/ioutil"
"net/http"
"log"
"regexp"
"strings"
)
@reedobrien
reedobrien / notepad.html
Created June 6, 2016 18:37 — forked from jdkanani/notepad.html
This bookmarklet gives you a code editor in your browser with a single click.
data:text/html, <style type="text/css">.e{position:absolute;top:0;right:0;bottom:0;left:0;}</style><div class="e" id="editor"></div><script src="http://d1n0x3qji82z53.cloudfront.net/src-min-noconflict/ace.js" type="text/javascript" charset="utf-8"></script><script>var e=ace.edit("editor");e.setTheme("ace/theme/monokai");e.getSession().setMode("ace/mode/ruby");</script>
<!--
For other language: Instead of `ace/mode/ruby`, Use
Markdown -> `ace/mode/markdown`
Python -> `ace/mode/python`
C/C++ -> `ace/mode/c_cpp`
Javscript -> `ace/mode/javascript`
Java -> `ace/mode/java`
Scala- -> `ace/mode/scala`