Skip to content

Instantly share code, notes, and snippets.

@trevershick
trevershick / adverbs.txt
Last active January 17, 2021 21:47
Word List
aback
abaft
abaxially
abeam
abed
abjectly
ably
abnormally
aboard
abominably
@trevershick
trevershick / test.cpp
Last active February 7, 2019 03:40
test.cpp
#include <cstring>
#include <functional>
#include <iostream>
#include <string>
#include <utility>
#include <vector>
class MyBuf : public std::streambuf {
public:
MyBuf(int maxLength, std::function<void(const char *, int)> callbackFn);
@trevershick
trevershick / CMakeLists.txt
Last active November 21, 2023 06:54
Simple client and server using libuv and unix domain sockets...
set(CMAKE_BUILD_TYPE Debug)
cmake_minimum_required(VERSION 2.8.12)
project(libuv1)
add_definitions("-std=c++11")
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
conan_basic_setup()
add_executable(server server.cpp)
var bucket = "a-bucket";
var filename = "logs/abc";
var event = {
"Records": [
{
"s3": {
"object": {
@trevershick
trevershick / mvncolor.sh
Last active September 17, 2015 13:24 — forked from katta/mvncolor.sh
Script to add colors to maven output
#!/usr/bin/env bash
# Formatting constants
export BOLD=`tput bold`
export UNDERLINE_ON=`tput smul`
export UNDERLINE_OFF=`tput rmul`
export TEXT_BLACK=`tput setaf 0`
export TEXT_RED=`tput setaf 1`
export TEXT_GREEN=`tput setaf 2`
export TEXT_YELLOW=`tput setaf 3`
@trevershick
trevershick / diff_from_trunk
Last active August 29, 2015 14:27
Subversion - Lists out all files that have changes when compared to trunk
# Lists out all files that have changes when compared to trunk
# this assumes the name of the current directory
# is the name of the folder in ^/trunk/<<folder>>
BASE=$(pwd); BASE=$(basename $BASE); svn diff ^/trunk/$BASE . | grep Index | grep "\." | cut -d " " -f2 | xargs basename | sort | uniq
@trevershick
trevershick / svn_short_log
Last active September 12, 2018 22:13 — forked from plexus/svn_short_log
svn log, one line per commit
#!/usr/bin/awk -f
# Convert the "svn log" output into a one liner format, which is easier to grep
# or use in scripts. Pipe "svn log" into this script
# When we get a line that starts with a revision number, put the data in variables
/^r[0-9]+/ {
rev=$1
user=$3
date=$5
// thanks https://gist.github.com/thomseddon/3511330
function formatBytes(bytes, precision) {
if (isNaN(parseFloat(bytes)) || !isFinite(bytes)) return '-';
if (typeof precision === 'undefined') precision = 1;
var units = ['bytes', 'kB', 'MB', 'GB', 'TB', 'PB'],
number = Math.floor(Math.log(bytes) / Math.log(1024));
return (bytes / Math.pow(1024, Math.floor(number))).toFixed(precision) + ' ' + units[number];
}
@trevershick
trevershick / console.js
Last active August 29, 2015 14:15
Simple, easy to use console replacement script for use in JsFiddle...
if (typeof($) === 'undefined') {
alert('jquery is required');
}
$("body").append($('<div id="console-log"></div>').css({
backgroundColor:'black',
color:'#33FF00',
padding:3
}));
var consoleLineCss = {

Setting Up Clojure on OS X

I spent a lot of time trying to find a pretty optimal (for me) setup for Clojure… at the same time I was trying to dive in and learn it. This is never optimal; you shouldn't be fighting the environment while trying to learn something.

I feel like I went through a lot of pain searching Google, StackOverflow, blogs, and other sites for random tidbits of information and instructions.

This is a comprehensive "what I learned and what I ended up doing" that will hopefully be of use to others and act as a journal for myself if I ever have to do it again. I want to be very step-by-step and explain what's happening (and why) at each step.

Step 1: Getting Clojure (1.3)