Skip to content

Instantly share code, notes, and snippets.

View indrekj's full-sized avatar

Indrek Juhkam indrekj

View GitHub Profile
See https://gist.github.com/indrekj/1a5ac479c9768d4b5bab
#!/bin/bash
author=`git config --get user.name`
commits() {
git log --author="$author" --no-merges --format="%ad %s" --date=short --date-order
}
main() {
LAST_DATE=""
import java.util.ArrayList;
import java.util.List;
public class HandlerChain<IN, OUT> {
private List<Handler<?, ?>> handlers = new ArrayList<Handler<?, ?>>();
private HandlerChain() {
}
:!mutant -r ./spec/spec_helper.rb --rspec-dm2 ::Inflecto\.underscore
Spec file(s): "spec/unit//class_methods/underscore_spec.rb" not found for Inflecto.underscore:/Users/indrek/inflecto/lib/inflecto.rb:43:9f2af
...
...
Took: (0.05s)
subjects: 1
mutations: 52
noop_fails: 0
class MakesBookingPayment
def initialize(booking, payment_details)
@booking = booking
@payment_details = payment_details
end
def pay!
response = process_payment
Transaction.record_purchase(@booking, response)
require "virtus"
module Bitbot
module Live
class Depth
include Virtus
attribute :price, Price
end
end
module Admin
class CategoriesController < BaseController
def new
@form = CategoryForm.new
end
def create
@form = CategoryForm.new(params[:category])
if @form.valid?
require "dm-mapper"
require "data_mapper/engine/arel"
DM = DataMapper::Environment.new
DM.engines[:arel] = DataMapper::Engine::Arel::Engine.new("sqlite3:/db/development.sqlite3")
require "virtus"
class Variant
include DataMapper::Model

Interactor

module Trip
  module Controls
    class AttendsTripOffer
      def initialize(request)
        Validator.validate!(request)

        @user = FacebookUserFetcher.get(request.access_token)
        @trip_offer = Repositories::TripOffer.find_by_id(request.trip_offer_id)
@indrekj
indrekj / gist:4054976
Created November 11, 2012 14:03
Counts how many times have files changed
#!/bin/bash
START=bff040e58fa3f00a5c8caada4d1c00718d2810f2
function filesChanged() {
prev=$START
revs=`git rev-list $START..HEAD --no-merges`
for rev in $revs; do
changed=`git diff --name-only $prev $rev --diff-filter=M`