Skip to content

Instantly share code, notes, and snippets.

(ns whatever.core
(:gen-class)
(:import [java.sql SQLException])
(:require [clojure.java.jdbc :as jdbc]
[clojure.java.jdbc.sql :as sql]
[clojure.pprint :as pprint]))
(def app-name "whatever")
(def env "development")

Tree Parse

I want to parse this (newlines are important):

L1
==1==
L2
L3

===1.1===

namespace :x do
@folders = %w(a b c)
desc "Run"
task :run do
puts @folders
end
end
@bluemont
bluemont / Default (OSX).sublime-keymap
Created March 9, 2013 08:51
Generate and insert a random UUID. Works with multiple selections: * If there are no selections, insert the UUID at each cursor position. * If there are one or more selections, replace the selection(s) with the UUID. I've tested this in Sublime Text 3, but it may also work for Sublime Text 2.
[
{ "keys": ["ctrl+shift+u"], "command": "insert_uuid" },
]
free -m
total used free shared buffers cached
Mem: 989 945 43 0 8 143
-/+ buffers/cache: 793 195
Swap: 511 301 210
@bluemont
bluemont / elasticsearch.yml
Created August 14, 2012 03:47
ElasticSearch Log
##################### ElasticSearch Configuration Example #####################
# This file contains an overview of various configuration settings,
# targeted at operations staff. Application developers should
# consult the guide at <http://elasticsearch.org/guide>.
#
# The installation procedure is covered at
# <http://elasticsearch.org/guide/reference/setup/installation.html>.
#
# ElasticSearch comes with reasonable defaults for most settings,
@bluemont
bluemont / catch_exception.rb
Created August 6, 2012 02:24 — forked from vhyza/catch_exception.rb
Removed require 'cgi' to avoid segmentation fault
# encoding: utf-8
STDOUT.sync = true
STDERR.sync = true
require 'pathname'
at_exit do
if (e = $!) && !e.instance_of?(SystemExit)
require "#{ENV['TM_SUPPORT_PATH']}/lib/escape"
@bluemont
bluemont / base_worker.rb
Created July 26, 2012 17:35
Shared behavior for interdependent Resque worker tasks
# Derive your workers from BaseWorker, but don't use it directly.
class BaseWorker
def self.perform(params)
document = find_document(params)
return if recently_processed?(document, params)
pre_process(document, params) or return
process_and_mark_as_processed(document, params) or return
post_process(document, params)
end
@bluemont
bluemont / README.markdown
Created July 19, 2012 18:02 — forked from tsnow/README.markdown
How to compile GitX

How to compile Gitx:

  1. Open GitX.xcodeproj in XCode.
  2. Switch scheme from cli-tool to GitX.
  3. Press ⇧⌘R (shortcut for: Product > Build For > Running).
  4. Press ⇧⌘2 to open the Organizer.
  5. Open the DerivedData folder shown in the Organizer window. (For example: ~/Library/Developer/Xcode/DerivedData/GitX-fpvndnywvssxinenuifhoszinvmk)
  6. Run the GitX.app located in {FOLDER}/Build/Products/Debug/GitX.app
@bluemont
bluemont / redis.markdown
Created July 13, 2012 22:44 — forked from bdotdub/redis.markdown
Running redis using upstart on Ubuntu

Running redis using upstart on Ubuntu

I've been trying to understand how to setup systems from the ground up on Ubuntu. I just installed redis onto the box and here's how I did it and some things to look out for.

To install: