Skip to content

Instantly share code, notes, and snippets.

View gniemira's full-sized avatar

Gerard Niemira gniemira

View GitHub Profile

Keybase proof

I hereby claim:

  • I am gniemira on github.
  • I am gjn (https://keybase.io/gjn) on keybase.
  • I have a public key ASAVeYSjxQIXi6yba5h9iroaut0thWAqSYTIlaPnfKejowo

To claim this, I am signing this object:

@gniemira
gniemira / states_hash.json
Created March 10, 2017 04:27 — forked from mshafrir/states_hash.json
US states in JSON form
{
"AL": "Alabama",
"AK": "Alaska",
"AS": "American Samoa",
"AZ": "Arizona",
"AR": "Arkansas",
"CA": "California",
"CO": "Colorado",
"CT": "Connecticut",
"DE": "Delaware",
@gniemira
gniemira / us_states_cities.json
Created March 10, 2017 04:26 — forked from msomu/us_states_cities.json
US states cities in JSON form
{
"Alabama": ["Autauga", "Baldwin", "Barbour", "Bibb", "Blount", "Bullock", "Butler", "Calhoun", "Chambers", "Cherokee", "Chilton", "Choctaw", "Clarke", "Clay", "Cleburne", "Coffee", "Colbert", "Conecuh", "Coosa", "Covington", "Crenshaw", "Cullman", "Dale", "Dallas", "DeKalb", "Elmore", "Escambia", "Etowah", "Fayette", "Franklin", "Geneva", "Greene", "Hale", "Henry", "Houston", "Jackson", "Jefferson", "Lamar", "Lauderdale", "Lawrence", "Lee", "Limestone", "Lowndes", "Macon", "Madison", "Marengo", "Marion", "Marshall", "Mobile", "Monroe", "Montgomery", "Morgan", "Perry", "Pickens", "Pike", "Randolph", "Russell", "Shelby", "St. Clair", "Sumter", "Talladega", "Tallapoosa", "Tuscaloosa", "Walker", "Washington", "Wilcox", "Winston"],
"Alaska": ["Anchorage", "Bethel", "Bristol Bay", "Dillingham", "Fairbanks North Star", "Haines", "Juneau", "Kenai Peninsula", "Ketchikan Gateway", "Kodiak Island", "Matanuska-Susitna", "Nome", "North Slope", "Prince of Wales-Outer Ketchikan", "Sitka", "Skagway-Hoonah-Angoon", "Sout
{"loans":[{"id":20000,"name":"Awat","description":{"languages":["en"],"texts":{"en":"Awat is 45 years old and lives with one of her children aged 21, while her other children are married and live separately. She sells snacks, beverages, household goods, etc. Her husband, Samin, does odd jobs and has an unfixed income. Therefore, this business is the source of their livelihood. She really would like to receive the $50 loan to complete her shop. She is a member of MBK and is willing to repay this loan within the loan period."}},"status":"paid","funded_amount":50,"paid_amount":50,"image":{"id":71156,"template_id":1},"activity":"General Store","sector":"Retail","use":"To complete her shop","location":{"country_code":"ID","country":"Indonesia","town":"Leuwisadeng, Bogor","geo":{"level":"country","pairs":"-5 120","type":"point"}},"partner_id":43,"posted_date":"2007-10-02T21:25:04Z","loan_amount":50,"lender_count":2,"bonus_credit_eligibility":false,"tags":[],"borrowers":[{"first_name":"Awat","last_name":"","gender":
@gniemira
gniemira / journal_eater.rb
Created February 28, 2014 04:47
Grab the last 10 pages of journals from the Kiva api and spit out an HTML page with them.
require 'httparty'
file = File.new("journals " + Time.now.to_s + ".html", "w")
file.puts '<!DOCTYPE html><html><head><title>Journals</title><script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script><link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css"><script src="http://netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script></head><body><div class="container">'
puts "making html file"
url = "http://api.kivaws.org/v1/journal_entries/search.json?newest&page="
page = 0
10.times do
When starting a project that includes refinerycms-blog:
$ rake refinery:override view=refinery/pages/*
$ rake refinery:override view=layouts/*
$ rake refinery:override view=refinery/blog/shared/*
$ rake refinery:override view=refinery/blog/posts/*
$ rake refinery:override view=refinery/*
$ rake refinery:override controller=refinery/blog/*
$ rake refinery:override controller=refinery/*
@gniemira
gniemira / heroku_cedar_hirefire_patch.rb
Created August 29, 2012 03:12 — forked from zefer/heroku_cedar_hirefire_patch.rb
Patch HireFire so worker auto-scaling works on the Beta Heroku Cedar stack
# hopefully a temporary patch so HireFire will run on the Heroku Cedar stack
# NB: the worker type is hard-coded as "worker" below, this must correlate to the type in Procfile
# NB: ENV['APP_NAME'] must be defined (e.g. 'heroku config:add APP_NAME=myherokuappname')
# using ps & ps_scale instead of info & set_workers
class HireFire::Environment::Heroku
private
def workers(amount = nil)
@gniemira
gniemira / arrowgasm.less
Created May 9, 2012 16:18 — forked from Kalyse/arrowgasm.less
LessCSS Mixing for Providing Arrows
.arrowgasm(@position: top, @size : "4px", @background-color : #88b7d5, @border-width: "2px", @border-color : #c2e1f5, @arrowClass : "arrow_box"){
(~".@{arrowClass}") {
position: relative;
background: @background-color;
border: @size solid @border-color;
}
(~".@{arrowClass}:after"), (~".@{arrowClass}:before") {
bottom: 100%;
border: solid transparent;