Skip to content

Instantly share code, notes, and snippets.

View sricho's full-sized avatar

Stuart Richardson sricho

  • Melbourne, Australia
View GitHub Profile
const test = require('tape')
const reduce = require('lodash').reduce
// [Element] -> {Name: Value}
const parseFormValues = (elements = []) => (
elements.reduce((result, { name, value }) => {
if (!name || !value) { return result }
return Object.assign(result, {
[name]: value,
})
const test = require('tape')
const application = (nameApi) => {
const name = nameApi.getRandomName()
return name.toUpperCase()
}
test('Application that uppercases names', (assert) => {
const apiStub = {
getRandomName() {

Keybase proof

I hereby claim:

  • I am sricho on github.
  • I am sturicho (https://keybase.io/sturicho) on keybase.
  • I have a public key whose fingerprint is 5C0D 2957 FF1F 5C8A A319 8B5D B699 313B 0580 3348

To claim this, I am signing this object:

brew update
brew install readline openssl rbenv ruby-build
# or, if you already have those installed, just upgrade ruby-build to get the latest list of rubies
brew update
brew upgrade ruby-build
CONFIGURE_OPTS="--disable-install-doc --with-readline-dir=$(brew --prefix readline) --with-openssl-dir=$(brew --prefix openssl)" \
rbenv install 2.2.0
require 'spec_helper'
describe Account::ProposalPresenter do
subject(:presenter) { Account::ProposalPresenter(user, proposal) }
describe '#title' do
it 'returns the type of object and who its from'
end
describe '#description' do
@sricho
sricho / gist:7592697
Last active December 29, 2015 01:19
Batch coupon generation
class Coupon::BatchGenerator
def self.generate(options = {})
new(options).generate
end
private_class_method :new
def initialize(options)
@options = defaults.merge(options)
end
@sricho
sricho / arrows.scss
Created September 1, 2011 04:15 — forked from bpainter/arrows.scss
Sass mixin for arrows based on The Shapes of CSS from Chris Coyier http://css-tricks.com/examples/ShapesOfCSS/
// --------------------------------------------------------
// arrows
// --------------------------------------------------------
// $direction: top, left, right, bottom, top-left, top-right, bottom-left, bottom-right
// $color: hex, rgb or rbga
// $size: px or em
// @example
// .element{
// @include arrow(top, #000, 50px);
// }