Skip to content

Instantly share code, notes, and snippets.

View cforcey's full-sized avatar

Charles Forcey cforcey

View GitHub Profile
@keithrbennett
keithrbennett / parse_json_multi_records.rb
Last active December 19, 2015 09:09
Parses a JSON file containing multiple objects that are not contained in a single object.
require 'yajl'
def parse(json_filespec)
json_file = File.new(json_filespec, 'r')
parser = Yajl::Parser.new
records = []
parser.parse(json_file) do |x|
records << x
end
records
@comp615
comp615 / leaflet_numbered_markers.css
Created April 2, 2012 23:51
Numbered Markers in Leaflet (JS Mapping)
.leaflet-div-icon {
background: transparent;
border: none;
}
.leaflet-marker-icon .number{
position: relative;
top: -37px;
font-size: 12px;
width: 25px;
class CreatePosts < ActiveRecord::Migration
def self.up
create_table :posts do |t|
t.timestamps
end
Post.create_translation_table! :title => :string, :text => :text
end
def self.down
drop_table :posts