Skip to content

Instantly share code, notes, and snippets.

View wkrsz's full-sized avatar

Wojtek Kruszewski wkrsz

View GitHub Profile
@jbenet
jbenet / simple-git-branching-model.md
Last active November 9, 2024 04:55
a simple git branching model

a simple git branching model (written in 2013)

This is a very simple git workflow. It (and variants) is in use by many people. I settled on it after using it very effectively at Athena. GitHub does something similar; Zach Holman mentioned it in this talk.

Update: Woah, thanks for all the attention. Didn't expect this simple rant to get popular.

@adamico
adamico / collection_check_boxes_input.rb
Last active April 28, 2020 15:12 — forked from mattclar/simple_form.rb
This fork adds a custom horizontal form wrapper and merges append/prepend in a 'group' wrapper
#app/inputs/collection_check_boxes_input.rb
class CollectionCheckBoxesInput < SimpleForm::Inputs::CollectionCheckBoxesInput
def item_wrapper_class
"checkbox-inline"
end
end
@clyfe
clyfe / simple_form.rb
Created August 22, 2013 08:20
Bootstrap3 compatible simple_form initializer
# http://stackoverflow.com/questions/14972253/simpleform-default-input-class
# https://github.com/plataformatec/simple_form/issues/316
inputs = %w[
CollectionSelectInput
DateTimeInput
FileInput
GroupedCollectionSelectInput
NumericInput
PasswordInput
@gonzalo-bulnes
gonzalo-bulnes / custom_form_builder.rb
Last active December 21, 2015 03:59
A sweet transition from Bootstrap 2.3 to Bootstrap 3 using a Simple Form custom form builder.
# lib/custom_form_builder.rb
# See https://github.com/plataformatec/simple_form#custom-form-builder
class CustomFormBuilder < SimpleForm::FormBuilder
def input(attribute_name, options = {}, &block)
if options[:wrapper_html]
options[:wrapper_html].merge! class: 'form-group'
else
options[:wrapper_html] = { class: 'form-group' }
end
@dsokolowski
dsokolowski / README.md
Created November 21, 2011 13:33
Integration capybara with minitest

##Integration capybara with minitest

Requirements:

  • ruby 1.9
  • gem capybara

All you have to do is to require file test_helper.rb at the beginning of your test files.

@eligrey
eligrey / object-watch.js
Created April 30, 2010 01:38
object.watch polyfill in ES5
/*
* object.watch polyfill
*
* 2012-04-03
*
* By Eli Grey, http://eligrey.com
* Public Domain.
* NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
*/
class Test::Unit::TestCase
private
def reload_activerecord_instances
self.instance_variables.each do |ivar|
if ivar.is_a?(ActiveRecord::Base) && ivar.respond_to?(:reload)
ivar.reload
end
end
end