Skip to content

Instantly share code, notes, and snippets.

@granthenke
granthenke / hadoop-aliases.sh
Last active May 10, 2020 23:21
A file containing useful/shortened aliases for use in Hadoop
# Generic Aliases
alias ll='ls -latr' # List all file in long list format by modification time
alias ..='cd ..' # Go up one directory
alias ...='cd ../..' # Go up two directories
alias ....='cd ../../..' # Go up three directories
alias -- -='cd -' # Go back
alias c='clear' # Clear Screen
alias k='clear' # Clear Screen
alias cls='clear' # Clear Screen
alias _="sudo" # Execute with sudo
@granthenke
granthenke / build.gradle
Created December 25, 2013 19:09
Runs code from the project the build script is building.
task runMyCode(dependsOn: 'classes', type: JavaExec) {
main = 'com.my.Code'
classpath = sourceSets.main.runtimeClasspath
args "arg1", "arg2"
}
@granthenke
granthenke / README.md
Created May 15, 2014 00:14
Gradle task to invalidate the cache for a single passed dependency

Gradle Invalidate Task

Note: This is just a quickly hacked together task

To Use:

  • Paste the task below in a gradle build file
  • Call gradle invalidate -Pdependency=group:name:version substituting the dependency you want to invalidate.
@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"
@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 / 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 / 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
<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 / 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==

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: