Skip to content

Instantly share code, notes, and snippets.

View jonmorehouse's full-sized avatar
💻
founder at nuon.co

Jon Morehouse jonmorehouse

💻
founder at nuon.co
View GitHub Profile
func (b *bigqueryGithubDataSink) executeQuery(queryStr string, cb func([]bigquery.Value, error) error) (context.CancelFunc, error) {
if !b.isInitialized() {
return nil, ErrDataSinkNotInitialized
}
transactionContext, cancelFunc := context.WithTimeout(b.clientContext, b.opts.ReadTransactionTimeout)
query := b.client.Query(queryStr)
rowIterator, err := query.Read(transactionContext)
if err != nil {
return cancelFunc, err
import subprocess
import sys
import select
cmd = 'git clone --progress https://github.com/jonmorehouse/dotfiles foobar'
p = subprocess.Popen(cmd.split(' '), stdout=subprocess.PIPE, stderr=subprocess.PIPE)
while True:
reads = [p.stdout.fileno(), p.stderr.fileno()]
import logging
def info(msg, **kwargs):
_log(msg, logging.info, kwargs)
def warning(msg, **kwargs):
_log(msg, logging.warning, kwargs)
package main
import (
"fmt"
"math/rand"
"time"
)
type Node struct {
value int
package main
import (
"fmt"
"sync"
"testing"
)
/*
Simple API for aggregating large sets of data that are cached in application memory.
package main
import (
"fmt"
"math/rand"
"time"
)
type ErrorA struct {}
func (e *ErrorA) Error() string { return "error a" }

Keybase proof

I hereby claim:

  • I am jonmorehouse on github.
  • I am jonmorehouse (https://keybase.io/jonmorehouse) on keybase.
  • I have a public key whose fingerprint is E1E9 6908 8283 DB60 7F85 4058 B790 9523 9D63 CD2F

To claim this, I am signing this object:

class FeedScreen < PM::Screen
def on_load
@control ||= begin
c = UISegmentedControl.plain ["all", "following"]
c.selectedSegmentIndex = 0
c.accessibilityLabel = "nav_control"
c.on :change.uicontrolevent do
switch_screens
end
c
@jonmorehouse
jonmorehouse / Rakefile
Last active August 29, 2015 14:04
Sample Rakefile using both firebase and objective-leveldb
# -*- coding: utf-8 -*-
$:.unshift("/Library/RubyMotion2.29/lib")
require 'motion/project/template/ios'
begin
require 'bundler'
Bundler.require
rescue LoadError
end
class UINavigationController
alias_method :superPopViewControllerAnimated, :popViewControllerAnimated
def popViewControllerAnimated(animated)
# call the will_present method of parent
if self.viewControllers[0].respond_to? :will_appear
self.viewControllers[0].send(:will_appear)
end