Skip to content

Instantly share code, notes, and snippets.

CHRUBY_VERSION="0.3.8"
RUBIES=()
for dir in "$PREFIX/opt/rubies" "$HOME/.rubies"; do
[[ -d "$dir" && -n "$(ls -A "$dir")" ]] && RUBIES+=("$dir"/*)
done
unset dir
function chruby_reset()
{
# This is a programming chellenge from David Bock's series
# "What Computer Scientists Know". This is a problem that can
# be used to discuss a bunch of computer science topics, but
# as I'm providing most of the skeleton of the solution, the
# point of this exercise is to demonstrate 'recursive backtracking'.
# http://en.wikipedia.org/wiki/Backtracking
# this problem is based on the classic 'triange peg game', a common
# sight in roadside diners in America, in particular, Cracker

Clojure West

Domain driven design with Clojure

  • Organizing larger applications
  • Domain logic shouldn’t include handlers for bad/unclean data.
    • validateur, bouncer, clj-schema for checking data going into the pipeline.
    • domain-specific, semantic checks
    • TODO: Any better ways for doing this conditional validation.
    • Need to factor out common data cleaning utils into shared library.
@jwieringa
jwieringa / prj_euler_001.clj
Last active December 30, 2015 09:49
How do I learn what idiomatic Clojure looks like?
;Multiples of 3 and 5
; If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23.
; Find the sum of all the multiples of 3 or 5 below 1000.
; Solve using seqs
; My personal favorite
; I like it because I think it is using lazy seqs which, if I understand things, is a great
; way to solve this problem in clojure. It does bother me that there are numbers being generated

Seven Primitives

Quote

> (quote a)
a

Atom

require 'spec_helper'
describe DashboardController do
include Factories::Godzilla
shared_examples "successfully gets the session cards" do
it "is successful" do
get :session_cards
def max(x, y)
x > y ? x : y
end
def max_or_zero(x, y)
max(0, max(x, y))
end

Irssi in Mac OS X Notification Center

Mou icon

Overview

This guide will explain how you can make irc messages in a screen on a remote server appear in your Mac OS X Lion Notification Center with the help of terminal-notifier.

We will also explain how the process can be automatically started each time you log in to your Mac and ensure the connection to the server is kept alive.

@jwieringa
jwieringa / gist:5797967
Created June 17, 2013 15:51
An example of a directive that reads and writes to scope.
laiApp.directive('demoGreet', function( $parse ) {
return {
link: function linkFn(scope, element, attrs) {
console.log('linkingFn(', scope, element, attrs, ')');
// read out of the scope
scope.$watch( attrs.demoGreet, function ( data ) {
element.text('Hello ' + data.name + '!' );
}, true);
@jwieringa
jwieringa / gist:5522106
Last active December 17, 2015 00:38
Javascript Books about Style, Culture, and Best Practices (a work in progress)