Skip to content

Instantly share code, notes, and snippets.

View leesharma's full-sized avatar

Lee Sharma leesharma

View GitHub Profile
@leesharma
leesharma / simple_form_materialize-sass.rb
Last active October 25, 2015 15:14 — forked from mediasota/gist:7c46c8e105acc386d62f
config/initializers/simple_form_materialize-sass.rb
# Use this setup block to configure all options available in SimpleForm.
SimpleForm.setup do |config|
config.error_notification_class = 'alert alert-danger'
config.button_class = 'waves-effect waves-light btn'
config.boolean_label_class = nil
config.wrappers :vertical_form, tag: 'div', class: 'input-field', error_class: 'has-error' do |b|
b.use :html5
b.use :placeholder
b.optional :maxlength
@leesharma
leesharma / triangle_peg.rb
Created June 14, 2016 18:57 — forked from bokmann/triangle_peg.rb
An example from "What Computer Scientists Know: Thinking Recursively, Part 2. In this example we are going to explore how we use our newfound knowledge of recursion to search through all the solutions of a simple puzzle using recursive backtracking.
# This is a programming chellenge from David Bock's series
# "What Computer Scientists Know". This is a problem that can
# be used to discuss a bunch of computer science topics, but
# as I'm providing most of the skeleton of the solution, the
# point of this exercise is to demonstrate 'recursive backtracking'.
# http://en.wikipedia.org/wiki/Backtracking
# this problem is based on the classic 'triange peg game', a common
# sight in roadside diners in America, in particular, Cracker