Skip to content

Instantly share code, notes, and snippets.

@Haar
Haar / .vimrc
Created November 10, 2016 12:10
" Shell stuffs
set shell=/bin/bash
" Tir_black colourscheme
syntax enable
filetype off
" set background=light
set t_Co=256
" Powerline
set laststatus=2
- if current_user.bank_accounts.empty? || current_user.client_bank_accounts.empty?
.panel.panel-default
.panel-heading
Getting Started
.panel-body
There are a few things you need to do before you can create a Split Payout:
%ul.list-group
- if current_user.bank_accounts.empty?
%li.list-group-item
= link_to 'Setup your bank account', new_user_bank_account_path
@Haar
Haar / simple.rb
Last active August 29, 2015 14:05
10.times do
print "Hello world"
end
(1..10).each do |integer|
print "Hello #{integer}"
end
(1..10).each do |integer|
if integer.odd?
AuditZoneArraySerializer = Struct.new(:audit_zone_array, :current) do
def to_json
self.audit_zone_array.inject([]) do |array, zone|
highlight = (zone == self.current)
ary << {
name: zone.description.titlecase,
y: zone.community_percentage,
sliced: highlight,

Keybase proof

I hereby claim:

  • I am haar on github.
  • I am tallguyrob (https://keybase.io/tallguyrob) on keybase.
  • I have a public key whose fingerprint is 243D 0D10 C2DF D80E 7769 7C35 B86E 385A F1A4 B959

To claim this, I am signing this object:

@Haar
Haar / arbitrary_mock_object.rb
Created October 17, 2013 13:31
Arbitrary property mocking sample in Ruby
class Mock
def initialize(property_hash)
@property_hash = property_hash
end
def method_missing(*args)
@property_hash[args.first] || ''
end
end
@Haar
Haar / ar_spec_helper.rb
Created October 2, 2013 20:09
WIP AR Spec Helper
require 'active_record'
connection_info = YAML.load_file("config/database.yml")["test"]
ActiveRecord::Base.establish_connection(connection_info) unless ActiveRecord::Base.connected?
factory_girl_loaded = FactoryGirl.factories.find(:account) rescue false
require 'shoulda/matchers/integrations/rspec'
require 'factory_girl_rails'
FactoryGirl.find_definitions unless factory_girl_loaded
@Haar
Haar / NSDate+RelativeDate.h
Last active December 23, 2015 11:39
Simple RelativeDate utility class for displaying dates relative to now. [date relativeString] == 3 days ago, 24 years from now, 2 seconds ago, etc.
//
// NSDate+RelativeDate.h
// RWRelativeDate
//
// Created by Robert White on 19/09/2013.
//
#import <Foundation/Foundation.h>
@interface NSDate (RelativeDate)
@Haar
Haar / STDOUT
Created September 15, 2013 19:59
NAME
branch - Setup git branch for the target story id
SYNOPSIS
sly [global options] branch id
@Haar
Haar / imdb_info.rb
Last active December 10, 2015 05:29
Grabs the first result of an IMDB query for a title passed in as the first argument on the command line and saves the image and basic description for the film.
require 'curb'
require 'json'
require 'fileutils'
include FileUtils
film_title = ARGV[0]
request = Curl::Easy.new("http://imdbapi.org/?title=#{film_title}&type=json&plot=simple&episode=1&limit=1&yg=0&mt=none&lang=en-US&offset=&aka=simple&release=simple")
request.perform