Skip to content

Instantly share code, notes, and snippets.

@dwerbam
dwerbam / inject_jquery.js
Created March 11, 2017 12:42
inject jquery bookmark
// create a browser bookmark, on the link url paste the following..
javascript: (function(e, s) { e.src = s; e.onload = function() { jQuery.noConflict(); console.log('jQuery injected'); }; document.head.appendChild(e); })(document.createElement('script'), '//code.jquery.com/jquery-latest.min.js')
@dwerbam
dwerbam / bashrc
Last active January 9, 2024 19:47
mcd alias, to create a directory and cd into it immediately
alias mcd='function _mcd(){ mkdir -p "$1"; cd "$1"; };_mcd'
#fix git to work behind a firewall
git config --global url.https://github.com/.insteadOf git://github.com/
@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">
@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 / 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 / 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 / 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 / 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 / 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
]