Skip to content

Instantly share code, notes, and snippets.

View smoll's full-sized avatar

Shujon Mollah smoll

View GitHub Profile
@smoll
smoll / gist:292a352839a2f503f588
Created September 15, 2014 16:29
hello world form from html in a URL
# Enter this into URL:
data:text/html,<h1 id="welcome">Hello, World!</h1><form>Name: <input type="text" id="name" required><br>Notes: <input type="text" id="notes"><input type="submit" id="submit_form"></form>
# Modified:
data:text/html,<h1 id="welcome">Hello, World!</h1><form>Name: <input type="text" id="name" required><br>Notes: <input type="text" id="notes"><input type="submit" id="new_submit"></form>
@smoll
smoll / add_up_single_column_in_tsv.rb
Last active August 29, 2015 14:04
Using Ruby and smarter_csv gem to process Statement Exports (Tab-separated values file with headers)
require 'benchmark'
require 'smarter_csv'
require 'bigdecimal' # using BigDecimal instead of Float
require 'bigdecimal/util'
# modify these variables
filename = "new_statement_detail_Yorck_Eysel_10942_Q12014.txt" # put the real path to your .txt file here
rows_per_chunk = 10000 # processes this many rows in each "chunk"
name_of_column = "Label Share Net Receipts"
number_format = "EU" # set this to "EU" or "US"