Skip to content

Instantly share code, notes, and snippets.

@hhutch
hhutch / default-admin-user.clj
Created January 16, 2012 21:19
example of using the default override in Pallet's automated-admin-user crate
;(require '[pallet.crate.automated-admin-user :as automated-admin-user])
;; ## Set Admin User with Assumptions(tm)
;; * assume that /home/USERNAME/.pallet exists
;; * keyfiles of the format ADMIN-USER_rsa and ADMIN-USER_rsa.pub are put in /home/USERNAME/.pallet
(defn set-admin-user
[admin-user]
(let [home-pallet-dir "/home/USERNAME/.pallet"]
(core/admin-user admin-user
:private-key-path (str home-pallet-dir "/" admin-user "_rsa")
@hhutch
hhutch / gist:2893517
Created June 8, 2012 04:09
Clojure Slides - JVM Languages - Philly Coders - June 6, 2012
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
lang="en" xml:lang="en">
<head>
<title>Clojure</title>
<meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"/>
<meta name="generator" content="Org-mode"/>
<meta name="generated" content="2012-06-07 23:17:36 EDT"/>
@hhutch
hhutch / echo.java
Created June 26, 2012 17:52
Attempted transliteration of vert.x echo server in Java to Clojure
package org.vertx.java.examples.echo;
import org.vertx.java.core.Handler;
import org.vertx.java.core.net.NetSocket;
import org.vertx.java.core.streams.Pump;
import org.vertx.java.deploy.Verticle;
public class EchoServer extends Verticle {
public void start() {
@hhutch
hhutch / fetch-repos.sh
Created September 10, 2012 04:01
find file changes in all forks of a github repo
curl -i https://api.github.com/repos/scrooloose/nerdtree/forks |grep -e "git_url" |awk '{gsub(/,/,"");split($2,a,"/"); system("mkdir "a[4]"; cd "a[4]"; git clone " $2);}'
@hhutch
hhutch / bash-throbber.sh
Last active December 14, 2015 19:38 — forked from anonymous/bash-throbber.sh
Throbber using UTF8 clock
#!/usr/bin/env bash
C="0" # count
while [ $C -lt 30 ]
do
case "$(($C % 11))" in
0) char="\xF0\x9F\x95\x90"
;;
1) char="\xF0\x9F\x95\x91"
;;
F#C#ScalaClojurePythonRubyHaskellSQLOCamlCommon LispErlangSmalltalkSchemeEcmascript 5Perl 5
mapSelectmapmapmapcollectmapSelectmapmapcarmapcollect:mapmapmap
filterWherefilterfilterfilterselectfilterWherefilterremove-if-notfilterselect:filterfiltergrep
foldAggregatefoldLeftreducereduceinjectfoldl
$ rake routes
Prefix Verb URI Pattern Controller#Action
tasks GET /tasks(.:format) tasks#index
POST /tasks(.:format) tasks#create
task GET /tasks/:id(.:format) tasks#show
PATCH /tasks/:id(.:format) tasks#update
PUT /tasks/:id(.:format) tasks#update
DELETE /tasks/:id(.:format) tasks#destroy
new_api_v1_user_session GET /api/v1/users/sign_in(.:format) api/v1/sessions#new
api_v1_user_session POST /api/v1/users/sign_in(.:format) api/v1/sessions#create
@hhutch
hhutch / keybase.md
Created June 4, 2014 21:16
keybase.io proof

Keybase proof

I hereby claim:

  • I am hhutch on github.
  • I am huntar (https://keybase.io/huntar) on keybase.
  • I have a public key whose fingerprint is 55C5 B5A7 3183 B8A3 42A4 6E5C 2817 C03B 0067 8908

To claim this, I am signing this object: