Skip to content

Instantly share code, notes, and snippets.

Avatar

David Coallier davidcoallier

View GitHub Profile
@davidcoallier
davidcoallier / twitter-rsa.r
Last active Aug 29, 2015
RSA Conference Twitter Term Cloud
View twitter-rsa.r
library("twitteR")
library("wordcloud")
library("tm")
# You running Windows? It's RSA... you probably are so this is for you.
# download.file(url="http://curl.haxx.se/ca/cacert.pem", destfile="cacert.pem")
# Go to https://dev.twitter.com/apps and get your keys from your register app there.
consumer_key <- 'YOUR CONSUMER KEY'
consumer_secret <- 'YOUR SECRET CONSUMER KEY'
View sortable.js
/*
SortTable
version 2
7th April 2007
Stuart Langridge, http://www.kryogenix.org/code/browser/sorttable/
Instructions:
Download this file
Add <script src="sorttable.js"></script> to your HTML
Add class="sortable" to any table you'd like to make sortable
View topojson.js
topojson = (function() {
function merge(topology, arcs) {
var arcsByEnd = {},
fragmentByStart = {},
fragmentByEnd = {};
arcs.forEach(function(i) {
var e = ends(i);
(arcsByEnd[e[0]] || (arcsByEnd[e[0]] = [])).push(i);
View ops-dash.json
{
"title": "Operations Logs",
"rows": [
{
"title": "Options",
"height": "50px",
"editable": true,
"collapse": false,
"collapsable": true,
"panels": [
View es.sh
cd ~
sudo apt-get update
sudo apt-get install openjdk-7-jre-headless -y
### Check http://www.elasticsearch.org/download/ for latest version of ElasticSearch and replace wget link below
# NEW WAY / EASY WAY
wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.1.0.deb
sudo dpkg -i elasticsearch-1.1.0.deb
View flume-ng.rb
require 'formula'
class FlumeNg < Formula
homepage 'https://github.com/apache/flume'
url 'http://archive.cloudera.com/cdh4/cdh/4/flume-ng-1.4.0-cdh4.6.0.tar.gz'
#sha1 '2217316f274ff615e9e7dc50f411d95edda60cc3'
version "1.4.0-cdh4.6.0"
def flume_ng_script
<<-EOS.undent
View fridey.md

Ingredients

Starter

  • Dill
  • 8 ounces of radish
  • 1/2 onion
  • 1/2 cup white vinegar,
  • 1/2 cup sugar, and
  • 1-1/2 teaspoons salt until sugar is dissolved.
View compare.R
cat(forecast_2w)
forecast_2w[1] == b_0 + (coeff * 12) // TRUE
forecast_2w[2] == b_0 + (coeff * 13) // TRUE
View a-gettext-callback.r
##
# Another helper for the laply
# Oh lazy dave when you'll re-read this code.
##
getText <- function(txt) {
txt$getText()
}