Skip to content

Instantly share code, notes, and snippets.

function java_change_16 {
export MY_JAVA_VERSION=1.6
export JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home
}
function java_change_17_15 {
export MY_JAVA_VERSION=1.7_15
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.7.0_15.jdk/Contents/Home/
}
@baroquebobcat
baroquebobcat / hello.bf
Last active December 27, 2015 14:09
Hello World in BrainFuck
++++++++++
[>+++++++>++++++++++>+++>+<<<<-]
>++.>+.+++++++..+++.>++.<<
+++++++++++++++.>.
+++.------.--------.>+.>.
function silencing_stderr() {
$* 2>/dev/null
}
function branch_names() {
git br | awk '{print $1}' | grep -v '*' | xargs
}
function most_recent_commit() {
git log . | grep "Date: " | cut -c 9- | head -1
function silencing_stderr() {
$* 2>/dev/null
}
function branch_names() {
git br | awk '{print $1}' | grep -v '*' | xargs
}
for branch_name in $(branch_names)
do
require 'csv'
module SQLAwesome
class RDBMS
def self.new_from_csv_dir directory
tables = {}
Dir["#{directory.chomp("/")}/*.csv"].each do |file|
table = []
CSV.foreach(file, headers: true) { |row| table << row }
tables[file.split("/").last.chomp(".csv")] = table
module Parslet::Atoms::DSL
def raw_as(name)
Parslet::Atoms::RawAttribute.new self, name
end
end
class Parslet::Atoms::RawAttribute < Parslet::Atoms::Base
attr_reader :parslet, :name
def initialize(parslet, name)
super()
# currently, this prints out
#
# 3
# 3
# 3
#
# I think each should introduce a new scope and the binding should be created for the runnable st
# it captures that scopes `i` instead of having the i be leaked to the outer scope
@@rs = []
@baroquebobcat
baroquebobcat / hash_map_mania.mirah
Created August 20, 2013 23:29
HashMap creation w/ concurrency across different jvm versions
import java.lang.Integer
import java.util.HashMap
import java.util.ArrayList
import java.util.List
import java.util.concurrent.LinkedBlockingQueue
class HashMapMania
def self.initialize:void
@@hole = LinkedBlockingQueue.new
end
# example from the documentation
# ==============================
params = ActionController::Parameters.new({
person: {
name: 'Francesco',
age: 22,
pets: [{
name: 'Purplish',
category: 'dogs'
}]
@baroquebobcat
baroquebobcat / ugly_input_reconsumption.rb
Created August 11, 2013 20:39
For when you want to get the source for an expression
class RawAttribute < Parslet::Atoms::Base
attr_reader :slice
def initialize(slice)
super()
@slice = slice
end
def apply(source, context, consume_all)