Skip to content

Instantly share code, notes, and snippets.

Andy Holland AMHOL

Block or report user

Report or block AMHOL

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@kule
kule / mini_rspec.rb
Created Sep 11, 2018
Simplified example of how rspec works
View mini_rspec.rb
require 'bundler/inline'
gemfile do
source 'https://rubygems.org'
gem 'colorize'
end
class MatcherInterface
def initialize(some_object)
@some_object = some_object
@keathley
keathley / dry_monad_usage.md
Last active Jan 29, 2020
A description of how to take advantage of the dry-monad gem.
View dry_monad_usage.md

How we're using dry-monad

Imagine that we have an application where user's have a location. We want to find the weather for their current location using an external service call. We want to provide this functionality in a json api. A basic implementation might look like this.

def create
  user = User.find(params[:id])
@solnic
solnic / rom-repo-crud.rb
Last active Apr 8, 2016
Upcoming rom-repository command support
View rom-repo-crud.rb
require "rom-repository"
require "rom-sql"
config = ROM::Configuration.new(:sql, 'postgres://localhost/rom_repository')
class Users < ROM::Relation[:sql]
def by_id(id)
where(id: id)
end
end
@davidpelaez
davidpelaez / custom_processor.rb
Created Mar 3, 2016
How to add custom steps to rom-mapper default Transproc processor. Useful to enhance the mapper with custom functionality and data transformations, e.g: lazy evaluation as presented in http://solnic.eu/2015/07/15/importing-data-with-rom-and-transproc.html
View custom_processor.rb
module Dataops
module Processors
class EnhancedAttributes < TransprocWithHook
BlockWrapper = Struct.new(:block) do
def call(*args)
self.block.call *args
end
end
@ef2k
ef2k / usr_bin_subl.sh
Last active Aug 10, 2016
Detach sublime from terminal (/usr/bin/subl)
View usr_bin_subl.sh
#!/bin/bash
# Detach sublime from terminal
nohup /opt/sublime_text_2/sublime_text --class=sublime-text-2 "$@" 2>/dev/null &
You can’t perform that action at this time.