Skip to content

Instantly share code, notes, and snippets.

View lahiruj's full-sized avatar

Lahiru Jayaratne lahiruj

View GitHub Profile
@paulund
paulund / add-option-to-dropdown.js
Created June 25, 2013 18:50
Add and Remove Options in Select using jQuery
$("#selectBox").append('<option value="option6">option6</option>');
@kokigit
kokigit / .irbrc
Last active October 18, 2018 09:08
to print rails(ruby) objects as indented(pretty json) json output add this function to ~/.irbrc file(if not exist create one). then it will be loaded with irb or rails console
def pp(obj)
puts JSON.pretty_generate({ "#{obj.class.name.underscore}" => obj }.as_json)
end
# console command
#pp Company.first
#and the output
# {