Skip to content

Instantly share code, notes, and snippets.

View kb's full-sized avatar

Kyle Bolton kb

View GitHub Profile
@kb
kb / cancel_all_running_dataflow_jobs.sh
Created May 13, 2020 22:28
Cancel all running Google Dataflow jobs
#!/usr/bin/env bash
for id in $(gcloud dataflow jobs list --status=active | grep Running | cut -c1-40); do
jobId=$(echo $id | tr -d ' ')
echo Cancelling dataflow job: "$jobId"
gcloud dataflow jobs cancel "$jobId" --region="us-central1"
done
@kb
kb / Installation.md
Last active November 7, 2019 21:02 — forked from albertbori/Installation.md
Automatically disable Wifi when an Ethernet connection (cable) is plugged in on a Mac

Overview

This is a bash script that will automatically turn your wifi off if you connect your computer to an ethernet connection and turn wifi back on when you unplug your ethernet cable/adapter. If you decide to turn wifi on for whatever reason, it will remember that choice. This was improvised from this mac hint to work with Yosemite, and without hard-coding the adapter names. It's supposed to support growl, but I didn't check that part. I did, however, add OSX notification center support. Feel free to fork and fix any issues you encounter.

Most the credit for these changes go to Dave Holland.

Requirements

  • Mac OSX 10+
  • Administrator privileges
@kb
kb / keybase.md
Created September 19, 2018 20:08

Keybase proof

I hereby claim:

  • I am kb on github.
  • I am kbolton (https://keybase.io/kbolton) on keybase.
  • I have a public key ASBaevrCvWkpSKxX3j20CN9EVx7XvMYuaBjZCPapgGBf_Ao

To claim this, I am signing this object:

<?xml version="1.0"?>
<ivy-module version="2.0">
<info organisation="redstorm" module="storm-deps"/>
<dependencies>
<dependency org="storm" name="storm" rev="0.8.2" conf="default" transitive="true" />
<override org="org.yaml" module="snakeyaml" rev="1.11" />
</dependencies>
</ivy-module>
--> Compiling Java
Compiling 8 source files to /crashlytics/storm-topologies/redstorm/target/classes
/crashlytics/storm-topologies/redstorm/target/src/redstorm/proxy/BatchBolt.java
/crashlytics/storm-topologies/redstorm/target/src/redstorm/proxy/BatchCommitterBolt.java
/crashlytics/storm-topologies/redstorm/target/src/redstorm/proxy/BatchSpout.java
/crashlytics/storm-topologies/redstorm/target/src/redstorm/proxy/Bolt.java
/crashlytics/storm-topologies/redstorm/target/src/redstorm/proxy/ProxyFunction.java
/crashlytics/storm-topologies/redstorm/target/src/redstorm/proxy/Spout.java
/crashlytics/storm-topologies/redstorm/target/src/redstorm/proxy/TransactionalCommitterSpout.java
/crashlytics/storm-topologies/redstorm/target/src/redstorm/proxy/TransactionalSpout.java
This file has been truncated, but you can view the full file.
0 Mon May 06 22:13:38 EDT 2013 META-INF/
146 Mon May 06 22:13:36 EDT 2013 META-INF/MANIFEST.MF
0 Thu Feb 21 10:23:02 EST 2013 META-INF/jruby.home/
0 Thu Feb 21 10:23:02 EST 2013 META-INF/jruby.home/bin/
0 Thu Feb 21 10:23:02 EST 2013 META-INF/jruby.home/lib/
0 Thu Feb 21 10:23:02 EST 2013 META-INF/jruby.home/lib/ruby/
0 Thu Feb 21 10:23:02 EST 2013 META-INF/jruby.home/lib/ruby/1.8/
0 Thu Feb 21 10:23:02 EST 2013 META-INF/jruby.home/lib/ruby/1.8/bigdecimal/
0 Thu Feb 21 10:23:02 EST 2013 META-INF/jruby.home/lib/ruby/1.8/cgi/
0 Thu Feb 21 10:23:02 EST 2013 META-INF/jruby.home/lib/ruby/1.8/cgi/session/
;;; pbcopy.el --- Emacs Interface to pbcopy
;; Copyright (C) 2011 Daniel Nelson, based on xclip.el, by Leo Shidai Liu
;; This file is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation; either version 3, or (at your option)
;; any later version.
;; This file is distributed in the hope that it will be useful,
@kb
kb / REAME.md
Created July 6, 2012 14:37 — forked from Bodacious/REAME.md
Transposing An Existing XCode Project to Rubymotion

For the last two weeks I've been working flat out with Rubymotion, a new toolchain that allows developers to build native iOS applications using the beautiful, elegant Ruby programming language instead of the verbose and somewhat fussy Objective-C programming language.

The app I've been working on is an existing client app we've been developing for several months. The app was about 80% ready for a pilot launch but still had quite a bit of development to go before being shipped. After discussing Rubymotion with the client, we agreed that it would save us both time and money in future development if we move over to Rubymotion. I was tasked with doing the migration; transposing the entire application to Rubymotion.

Timescale

For those of you looking to do the same, here are some stats that might help you estimate the time required and the costs

class MyGroupedListController < UIViewController
attr_accessor :posts
attr_accessor :sections
class TableViewSection
attr_accessor :title
attr_accessor :items
def initialize(params={})
@title = params[:title]
@kb
kb / gist:1515105
Created December 23, 2011 19:11
MongoDB Production Log output for a Rails request
MONGODB prod['system.namespaces'].find({})
MONGODB cursor.refresh() for cursor 3083105591931248794
MONGODB prod['accounts'].find({:_id=>BSON::ObjectId('4ed7cad4d9479e5813000498')}).sort([[:_id, :asc]])
MONGODB prod['system.namespaces'].find({})
MONGODB cursor.refresh() for cursor 3314765858610684320
MONGODB prod['organizations'].find({:_id=>BSON::ObjectId('4ebc6a04d9479e37be0018c9')}).sort([[:_id, :asc]])
MONGODB prod['system.namespaces'].find({})
MONGODB cursor.refresh() for cursor 1652175522883772840
MONGODB prod['apps'].find({"organization_id"=>BSON::ObjectId('4ebc6a04d9479e37be0018c9'), :bundle_identifier=>"com.mediafriendsinc.iwire", :status=>{"$ne"=>:new}}).sort([[:_id, :asc]])
MONGODB prod['system.namespaces'].find({})