Skip to content

Instantly share code, notes, and snippets.

@IndianGuru
IndianGuru / jruby10.rb
Created September 5, 2011 10:07
JRuby and Amazon S3
require "rubygems"
require "bundler/setup"
require 'yaml'
require 'aws-sdk'
#require 'jruby-openssl'
bucket_name = "talim"
file_name = "jrubyaws.txt"
(ns storm.starter.clj.exclamation
(:import [backtype.storm StormSubmitter LocalCluster])
(:use [backtype.storm clojure config])
(:gen-class))
(defspout test-word-spout ["word"] {:prepare false}
[collector]
(Thread/sleep 100)
(emit-spout! collector [(rand-nth ["first" "second" "third" "fourth"])]))
@stuartsierra
stuartsierra / clojurescript-project.clj
Created January 20, 2012 18:04
project.clj for ClojureScript project
(defproject foo "1.0.0-SNAPSHOT"
:description "FIXME: write description"
:dependencies [[org.clojure/clojure "1.3.0"]
[org.clojure/clojurescript "0.0-927"]])
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active November 20, 2024 03:08
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@bmabey
bmabey / user_agent.clj
Created October 24, 2012 15:55
Example of using the java lib UserAgentUtils in clojure to parse user agent strings
(ns rbl.feature-extraction.user-agent
(:use [clojure.core.memoize :only [memo]])
(:require [clojure.tools.logging :as log])
(:import [nl.bitwalker.useragentutils UserAgent DeviceType Browser OperatingSystem]))
(defn str->features [string]
(try
(let [user-agent (UserAgent. (or string ""))]
{:browser_group (-> user-agent .getBrowser .getGroup .getName)
:os_group (-> user-agent .getOperatingSystem .getGroup .getName)
@coliver
coliver / jameswhitemanifesto.txt
Created May 22, 2014 14:58
James White Manifesto
== Rules ==
On Infrastructure
-----------------
There is one system, not a collection of systems.
The desired state of the system should be a known quantity.
The "known quantity" must be machine parseable.
The actual state of the system must self-correct to the desired state.
The only authoritative source for the actual state of the system is the system.
The entire system must be deployable using source media and text files.
@bhenry
bhenry / plink-plonk.js
Created February 25, 2020 20:20 — forked from tomhicks/plink-plonk.js
Listen to your web pages