Skip to content

Instantly share code, notes, and snippets.

@dwerbam
dwerbam / Code.gs
Last active June 18, 2017 11:16
Gmail Scheduler
function installScript() {
// Makes sure that only 1 scheduler is installed
uninstallScript();
// Trigger every 1 hour.
ScriptApp.newTrigger('gmailScheduler')
.timeBased()
.everyHours(1)
.create();
@dwerbam
dwerbam / .bash_profile
Last active August 27, 2015 10:03 — forked from natelandau/.bash_profile
Mac OSX Bash Profile
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
# 4. Searching
# 5. Process Management
@dwerbam
dwerbam / gist:23fca539b116f799bf62
Last active August 28, 2015 00:12
docker toolbox create extended filesystem
docker-machine create --driver virtualbox dev --virtualbox-disk-size "50gb"
eval "$(docker-machine env dev)"
#additionally you can
docker-machine env dev >> ~/.bash_profile
#verify..
vim ~/.bash_profile
@dwerbam
dwerbam / gist:db5a267d81acd9bb178c
Created September 2, 2015 11:01
enable grails debugger in intellij, without remote debug
// add this to grails-app/conf/BuildConfig.groovy:
grails.project.fork = [
test: false,
run: false
]
@dwerbam
dwerbam / rstudo-sparkr.R
Last active September 8, 2015 14:09 — forked from shivaram/rstudo-sparkr.R
Rstudio local setup
Sys.setenv(SPARK_HOME="/Users/shivaram/spark-1.4.1")
.libPaths(c(file.path(Sys.getenv("SPARK_HOME"), "R", "lib"), .libPaths()))
library(SparkR)
sc <- sparkR.init(master="local")
sqlContext <- sparkRSQL.init(sc)
df <- createDataFrame(sqlContext, faithful)
# Select one column
head(select(df, df$eruptions))
@dwerbam
dwerbam / dataframe_example.R
Last active September 8, 2015 14:09 — forked from shivaram/dataframe_example.R
DataFrame example in SparkR
# Download Spark 1.4 from http://spark.apache.org/downloads.html
#
# Download the nyc flights dataset as a CSV from https://s3-us-west-2.amazonaws.com/sparkr-data/nycflights13.csv
# Launch SparkR using
# ./bin/sparkR --packages com.databricks:spark-csv_2.10:1.0.3
# The SparkSQL context should already be created for you as sqlContext
sqlContext
# Java ref type org.apache.spark.sql.SQLContext id 1
@dwerbam
dwerbam / sparkr-demo
Last active September 8, 2015 14:10 — forked from shivaram/sparkr-demo
SparkR 1.4.1 Demo
# If you are using Spark 1.4, then launch SparkR with the command
#
# ./bin/sparkR --packages com.databricks:spark-csv_2.10:1.0.3
# as the `sparkPackages=` flag was only added in Spark 1.4.1.
# # This will work in Spark 1.4.1.
sc <- sparkR.init(spark_link, sparkPackages = "com.databricks:spark-csv_2.10:1.0.3")
sqlContext <- sparkRSQL.init(sc)
flights <- read.df(sqlContext, "s3n://sparkr-data/nycflights13.csv","com.databricks.spark.csv", header="true")
@dwerbam
dwerbam / gist:c67ff354022a1f6d5f56
Created October 4, 2015 11:43
replaces the capslock key for a ctrl in linux
#this command replaces the capslock key for a ctrl. (does not replace ctrl in any way)
setxkbmap -option ctrl:nocaps
# To make this setting persist on Ubuntu, open the dash, search for “Start,” and launch the
# Start-up applications dialog. You can also press Alt+F2, type gnome-session-properties
# into the Run dialog, and press Enter. Add the command to your list of startup commands
# and it will run when you log in.
@dwerbam
dwerbam / designer.html
Last active November 4, 2015 13:19
designer
<link rel="import" href="../core-scaffold/core-scaffold.html">
<link rel="import" href="../core-header-panel/core-header-panel.html">
<link rel="import" href="../core-menu/core-menu.html">
<link rel="import" href="../core-item/core-item.html">
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../core-menu/core-submenu.html">
<polymer-element name="my-element">
@dwerbam
dwerbam / designer.html
Created November 9, 2015 18:53
designer
<link rel="import" href="../core-scaffold/core-scaffold.html">
<link rel="import" href="../core-header-panel/core-header-panel.html">
<link rel="import" href="../core-menu/core-menu.html">
<link rel="import" href="../core-item/core-item.html">
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../core-menu/core-submenu.html">
<polymer-element name="my-element">