Skip to content

Instantly share code, notes, and snippets.

@granthenke
granthenke / Dockerfile
Last active August 2, 2019 13:10
Turtles docker image. Docker containers inside of docker containers recursively. A case of because I can, not because I should...
FROM docker:dind as turtles
VOLUME ["/image"]
COPY ./turtles.sh /tmp
WORKDIR /tmp
ENTRYPOINT ["./turtles.sh"]
CMD ["turtle"]
@granthenke
granthenke / .gitignore_global
Created July 24, 2018 14:56
My global gitignore configuration
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #
@granthenke
granthenke / emojipacks-loader.sh
Created March 28, 2018 15:10
A short script to load a bunch of emojis with https://github.com/lambtron/emojipacks
# Set slack subdomain, email, and password
subdomain=
email=
password=
declare -a urls=(
"https://raw.githubusercontent.com/lambtron/emojipacks/master/packs/slackmojis-uncategorized.yaml"
"https://raw.githubusercontent.com/lambtron/emojipacks/master/packs/slackmojis-meme.yaml"
"https://raw.githubusercontent.com/lambtron/emojipacks/master/packs/slackmojis-party-parrot.yaml"
"https://raw.githubusercontent.com/lambtron/emojipacks/master/packs/animals.yaml"
"https://raw.githubusercontent.com/lambtron/emojipacks/master/packs/officespace.yaml"

Keybase proof

I hereby claim:

  • I am granthenke on github.
  • I am granthenke (https://keybase.io/granthenke) on keybase.
  • I have a public key ASDr8gviy0-NvnYlRQ3lJYcMgWL3A9EVx-YWFyarDcswKAo

To claim this, I am signing this object:

@granthenke
granthenke / yahoo-pro-pickem-autofill-2016.user.js
Created September 8, 2016 16:19
Yahoo! Pro Football Pickem AutoFill 2016: A user script that adds a button to automatically pick the favorited teams based on pick distribution
// ==UserScript==
// @name Yahoo! Pro Football Pickem AutoFill 2016
// @namespace https://gist.github.com/granthenke/
// @version 0.1
// @description Adds a button to automatically pick the favorited teams based on pick distribution
// @author Grant Henke
// @match https://football.fantasysports.yahoo.com/pickem/*/*
// @grant none
// @run-at document-idle
// ==/UserScript==
<h4>Api Keys</h4><p>The following are the numeric codes that the ApiKey in the request can take for each of the above request types.</p><table class="data-table"><tbody>
<tr>
<th>Name</th>
<th>Key</th>
</tr>
<tr>
<td>Produce</td><td>0</td></tr>
<tr>
<td>Fetch</td><td>1</td></tr>
<tr>
@granthenke
granthenke / generateJoin.scala
Created June 11, 2015 17:58
Script to generate join function for Scala Futures
val types = {
for {
end <- 'B' to 'V' // v = 22
types = 'A' to end
} yield types
}
types.foreach { types =>
def typeToArgument(T: Char) = s"f${T.toLower}: Future[$T]"
def typeToForArgument(T: Char) = s"$T <- f$T".toLowerCase
@granthenke
granthenke / sparkMean.scala
Created April 2, 2015 21:51
Scala Scratch Pad
case class MeanM(sum: Double, count: Long) {
def +(that: MeanM): MeanM = {
new MeanM(this.sum + that.sum, this.count + that.count)
}
def mean = sum / count.toDouble
}
val data = List(("cust1", 1.0),("cust1", 5.0),("cust2", 6.0))
val dataRDD = sc.makeRDD(data)
@granthenke
granthenke / Client.scala
Created March 17, 2015 03:22
Client Reuse
class Client(connection: String) {
println("New Client: " + connection)
}
object Client {
private val clients = new mutable.HashMap[String, Client]()
def apply(connection: String): Client = {
clients.getOrElse(connection, createClient(connection))
}
@granthenke
granthenke / avro.gradle
Created May 17, 2014 03:25
A drop in script to add simple and configurable Avro file compilation support
// A drop in script to add simple and configurable Avro file compilation support
buildscript {
repositories {
mavenCentral()
mavenLocal()
}
dependencies {
classpath([
"org.apache.avro:avro-tools:1.7.4"