Skip to content

Instantly share code, notes, and snippets.

# OSX for Hackers (Mavericks/Yosemite)
#
# Source: https://gist.github.com/brandonb927/3195465
#!/bin/sh
# Some things taken from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Ask for the administrator password upfront

Folder Structure

Motivations

  • Clear feature ownership
  • Module usage predictibility (refactoring, maintainence, you know what's shared, what's not, etc)
  • CI runs only the tests that matter (future)
package my.elasticsearch;
import java.io.File;
import java.io.IOException;
import java.io.RandomAccessFile;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;
@yarinb
yarinb / performanceSpec.scala
Last active August 30, 2015 22:10
Json4s with many custom formats
package com.indeni.measurements
import com.mongodb.DBObject
import com.mongodb.util.JSON
import org.json4s.ext.JodaTimeSerializers
import org.json4s.mongo.JObjectParser
import org.json4s.{DefaultFormats, Formats, JValue}
import org.scalatest._
case class SimpleObject(name: String, map: Map[String, Long], aNumber: Long)
@yarinb
yarinb / git-setup.sh
Created August 16, 2011 16:28
Git setup niceties
# via https://gist.github.com/419201#file_gitconfig.bash
# Install (from Matt's gist) these useful Git aliases & configurations with the following command:
# $ bash <(curl -s https://raw.github.com/gist/419201/gitconfig.bash)
git config --global color.ui auto # colorize output (Git 1.5.5 or later)
git config --global color.interactive auto # and from 1.5.4 onwards, this will works:
echo "Set your name & email to be added to your commits."
echo -n "Please enter your name: "
@yarinb
yarinb / env
Created September 27, 2011 18:19
current env
# This loads some niceties for irb, courtesy of rvm.
# It also loads your custom ~/.irbrc if it exists.
# If you want to customize the irbrc for ONLY this version of
# ruby then edit this file. It will only be deleted if you do
# an "rvm install" over this ruby version.
if ENV["rvm_path"].nil?
require File.join(ENV["HOME"], "irbrc")
else
@yarinb
yarinb / jirb
Created September 27, 2011 18:09
Jirb doesn't work properly without JRUBY_OPTS
➜ ~ rvm use jruby
Using /Users/yarinb/.rvm/gems/jruby-1.6.4
➜ ~ which jirb (jruby-1.6.4)
/Users/yarinb/.rvm/rubies/jruby-1.6.4/bin/jirb
➜ ~ jirb (jruby-1.6.4)
Object.new
Object.new
#<Object:0x62565cf8>
1+1
1+1
@yarinb
yarinb / rbenv-install-system-wide.sh
Created October 11, 2011 12:51
rbenv install and system wide install on Ubuntu 10.04 LTS.
# Update, upgrade and install development tools:
apt-get update
apt-get -y upgrade
apt-get -y install build-essential
apt-get -y install git-core
# Extras for RubyGems and Rails:
apt-get -y install zlib1g-dev
apt-get -y install libssl-dev libsqlite3-dev
apt-get -y install libreadline5-dev
@yarinb
yarinb / ubuntu-11.10-gems.erb
Created October 18, 2011 23:33 — forked from kashif/ubuntu-11.10-gems.erb
Chef bootstrap With rvm and ruby 1.9.2 on ubuntu 11.10
bash -c '
<% if knife_config[:bootstrap_proxy] -%>
(
cat <<'EOP'
<%= "proxy = #{knife_config[:bootstrap_proxy]}" %>
EOP
) > ~/.curlrc
<% end -%>
if [ ! -f /usr/bin/chef-client ]; then
@yarinb
yarinb / gist:1389255
Created November 23, 2011 17:15
compass config in config/compass.rb
# This configuration file works with both the Compass command line tool and within Rails.
# Require any additional compass plugins here.
project_type = :rails
sass_options = {:debug_info => true}
# Set this to the root of your project when deployed:
http_path = "/"
# You can select your preferred output style here (can be overridden via the command line):