Skip to content

Instantly share code, notes, and snippets.

(defn go-right [[x y]] {:pos [(inc x) y]})
(defn go-left [[x y]] {:pos [(dec x) y]})
(defn go-down [[x y]] {:pos [x (inc y)]})
(defn go-up [[x y]] {:pos [x (dec y)]})
;; I'm pretty (cool) and I know it!
(defn enterprise-buzz
"To infinity and beyond!"
[look {[x y] :pos}]
(println (look [ x y]))
@aterreno
aterreno / nginx.conf
Created August 12, 2013 07:20
Let's say that for some reason you want to execute an OS command via HTTP.. This nginx config does it by using LUA. http://openresty.org/ kicks ass.
worker_processes 1;
user root;
error_log logs/error.log;
events {
worker_connections 1024;
}
http {
server {
listen 8080;
location / {
@aterreno
aterreno / es.sh
Created May 9, 2013 16:42
Bash script that includes all you need to know on ES.
#!/bin/bash
export HOST="http://10.251.76.43:9201"
echo \
#deletes index
curl -XDELETE "$HOST/article-light/"
echo \
@aterreno
aterreno / Project Side Bar.py
Created April 9, 2013 09:12
Simple python script to get the the folder view to sync with the current file in the editor.
# vi ~/Library/Application\ Support/Sublime\ Text\ 2/Packages/Project\ Side\ Bar/Project\ Side\ Bar.py
import sublime
import sublime_plugin
class SideBarListener(sublime_plugin.EventListener):
def on_activated(self, view):
view.window().run_command('reveal_in_side_bar')
@aterreno
aterreno / .gitconfig
Last active January 25, 2021 17:00
my .gitconfig
[user]
name = Antonio Terreno
email = antonio.terreno@example.com
[alias]
aliases = !git config --get-regexp alias | sed -re 's/alias\\.(\\S*)\\s(.*)$/\\1 = \\2/g'
up = !git pull --rebase --autostash
co = checkout
br = branch
ci = commit
st = status
@aterreno
aterreno / .gitignore
Last active January 15, 2018 10:57
Sort of default .gitignore for clojure development with emacs, mac os, lein and random hacking with vi from time to time, why not
.DS_Store
*~
\#*\#
.\#*
*.swp
require 'posterous'
require 'time'
module Posterous
module Connection
def default_options
@default_options ||= {
#:username => Posterous.config['username'],
#:password => Posterous.config['password']
:userpwd => Posterous.config['username']+":"+Posterous.config['password']
@aterreno
aterreno / posterous.rb
Last active December 14, 2015 01:08
Migration script from http://posterous.com/ to github pages, forked from https://github.com/AlexeyMK/alexeymk.github.com/blob/master/posterous_import.rb with a monkey patch on Posterous Connection.
require 'rubygems'
require 'jekyll'
require 'fileutils'
require 'posterous'
require 'net/http'
require 'URI'
puts ARGV, "IS ARGV"
module Posterous
@aterreno
aterreno / hadoop.Applescript
Created June 28, 2011 09:30
ssh into hadoop cluster
-- Launch iTerm and log into multiple servers using SSH
tell application "iTerm"
activate
-- Read serverlist from file path below
set Servers to paragraphs of (do shell script "/bin/cat $HOME/Serverslist")
repeat with nextLine in Servers
-- If line into file is not empty (blank line) do the rest
if length of nextLine is greater than 0 then
set server to "nextLine"
set term to (current terminal)
@aterreno
aterreno / big.sh
Created May 16, 2011 08:27
list of 10 biggest files
du -a / | sort -n -r | head -n 10