This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Your OS X is ripe for brewing. | |
Any troubles you may be experiencing are likely purely psychosomatic. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Licensed to the Apache Software Foundation (ASF) under one or more | |
* contributor license agreements. See the NOTICE file distributed with | |
* this work for additional information regarding copyright ownership. | |
* The ASF licenses this file to You under the Apache License, Version 2.0 | |
* (the "License"); you may not use this file except in compliance with | |
* the License. You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defprotocol P | |
(foo [x]) | |
(bar-me [x] [x y])) | |
(deftype Foo [a b c] | |
P | |
(foo [x] a) | |
(bar-me [x] b) | |
(bar-me [x y] (+ c y))) | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defprotocol ToClojure | |
(to-clojure [x] "Convert hector types to Clojure data structures")) | |
(extend-protocol ToClojure | |
RowsImpl | |
(to-clojure [s] | |
(map to-clojure (iterator-seq (.iterator s)))) | |
RowImpl | |
(to-clojure [s] | |
{:key (.getKey s) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
global | |
log 127.0.0.1 local0 | |
log 127.0.0.1 local1 notice | |
maxconn 1000 | |
daemon | |
user haproxy | |
group haproxy | |
defaults | |
log global |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns four-clojure | |
(:use clojure.test)) | |
(defn pen [coll] | |
(last (drop-last coll))) | |
(deftest penultimate-element | |
(is (= (pen (list 1 2 3 4 5)) 4)) | |
(is (= (pen ["a" "b" "c"]) "b")) | |
(is (= (pen [[1 2] [3 4]]) [1 2]))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'rbhive' | |
RBHive.connect('hive.server.address') do |connection| | |
connection.fetch 'SELECT * FROM cities' | |
end | |
# => [["London", "UK"], ["New York", "USA"], ["Mumbai", "India"]] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
start on runlevel [2345] | |
stop on runlevel [06] | |
respawn | |
script | |
export HOME="/home/deploy" | |
export JAVA_HOME="/usr/lib/jvm/java-6-sun" | |
export HIVE_HOME="/usr/lib/hive" | |
export HADOOP_HOME="/usr/lib/hadoop" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns defnk-example | |
(:use [clojure.contrib.def :only (defnk)])) | |
(defnk some-fn | |
[x y :opt1 :a :opt2 :b] | |
(str "x: " x " opt1: " opt1 " opt2: " opt2)) | |
defnk-example> (some-fn "x" "y" :opt1 5 :opt2 10) | |
"x: x opt1: 5 opt2: 10" | |
defnk-example> (some-fn "x" "y") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if @env['HTTPS'] == 'on' | |
'https' | |
elsif @env['HTTP_X_FORWARDED_SSL'] == 'on' | |
'https' | |
elsif @env['HTTP_X_FORWARDED_PROTO'] | |
@env['HTTP_X_FORWARDED_PROTO'].split(',')[0] | |
else | |
@env["rack.url_scheme"] | |
end |