Skip to content

Instantly share code, notes, and snippets.

View lostmarinero's full-sized avatar

Kevin Berry lostmarinero

View GitHub Profile
@lostmarinero
lostmarinero / ReqCheck-Extractor-Readme
Created March 6, 2017 17:50
This gist is a copy of the readme file for "ReqCheck-Extractor", an Extract-Transform-Load process developed by the 2016 Code for Americas Team for the Kansas City, Missouri Public Health Department.
# ReqCheck-Extractor
This is the original ReqCheck-Extractor Project, developed by the Code for America's 2016 Kansas City, Missouri (KCMO) Fellowship Team in collaraboration with the KCMO Health Department.
A special thank you to the staff at the [Kansas City Health Department](http://kcmo.gov/health/clinic-services/) for their help developing it.
This project is a script for extracting data from a database, transforming it, and sending it to a website running [Project ReqCheck](https://github.com/KCMOHealthDepartment/reqcheck).
## How It Works
This is a project, written in Python, that can be bundled into a Microsoft Batch File (*.bat).
@lostmarinero
lostmarinero / ReqCheck-Extractor-Readme
Created March 6, 2017 17:50
This gist is a copy of the readme file for "ReqCheck-Extractor", an Extract-Transform-Load process developed by the 2016 Code for Americas Team for the Kansas City, Missouri Public Health Department.
# ReqCheck-Extractor
This is the original ReqCheck-Extractor Project, developed by the Code for America's 2016 Kansas City, Missouri (KCMO) Fellowship Team in collaraboration with the KCMO Health Department.
A special thank you to the staff at the [Kansas City Health Department](http://kcmo.gov/health/clinic-services/) for their help developing it.
This project is a script for extracting data from a database, transforming it, and sending it to a website running [Project ReqCheck](https://github.com/KCMOHealthDepartment/reqcheck).
## How It Works
This is a project, written in Python, that can be bundled into a Microsoft Batch File (*.bat).
from operator import (
add,
sub,
mul,
div,
mod,
pow
)
@lostmarinero
lostmarinero / data_summary_census_tracts.py
Last active August 29, 2015 14:25
This is the challenge as submitted to apply to the Code For America Fellowship
import csv
def convert_to_lowercase(input_word):
return input_word[0].lower() + input_word[1:]
def convert_to_python_style(input_word):
return '_'.join(
[
convert_to_lowercase(individual_word)
@lostmarinero
lostmarinero / flight_route.rb
Created January 14, 2014 18:52
This is a coding challenge focused on finding all the routes for a network of flights. I added Portland as a city to make it a little more complex. The original challenge: Express the following table as a static structure, and write a function, find_routes(source, destination) that efficiently outputs all possible routes.
# Flights, Ruby
#
# Express the following table as a static structure,
# and write a function, find_routes(source, destination) that
# efficiently outputs all possible routes.
#
# Source | Dest
# ~~~~~~ ~~~~
# Seattle | LA
# LA | Florida
@lostmarinero
lostmarinero / sports_scoring.rb
Created January 14, 2014 18:47
This was a challenge as posted on reddit: http://www.reddit.com/r/dailyprogrammer/comments/1undyd/010714_challenge_147_easy_sport_points/ The challenge: You must write code that verifies the awarded points for a fictional sport are valid. This sport is a simplification of American Football scoring rules. This means that the score values must be …
# 6 points for a "touch-down"
# 3 points for a "field-goal"
# 1 point for an "extra-point"; can only be rewarded after a touch-down. Mutually-exclusive with "two-point conversion"
# 2 points for a "two-point conversion"; can only be rewarded after a touch-down. Mutually-exclusive with "extra-point"
class Scoring
attr_reader :max_number_each, :scoring_values
attr_accessor :score, :counter
@lostmarinero
lostmarinero / card_shuffler.rb
Last active January 3, 2016 06:29
This was a coding challenge for a company. The question was: ShufflinGiven a deck of n unique cards, cut the deck c cards from the top and perform a perfect shuffle. A perfect shuffle is where you put down the bottom card from the top portion of the deck followed by the bottom card from the bottom portion of the deck. This is repeated until one …
# Given a deck of n unique cards, cut the deck c cards from the top and perform a perfect shuffle.
# A perfect shuffle is where you put down the bottom card from the top portion of the deck followed by the bottom card from the bottom portion of the deck.
# This is repeated until one portion is used up. The remaining cards go on top.
# We want an algorithm that will determine the number of perfect shuffles that will need to happen before the deck returns to its original order. This can be done in any language.
# A successful solution will solve the problem for 1002 cards and a cut size of 101 in under a second even on a slow machine.
class Shuffler
attr_reader :initial_cards, :cut, :top_cut, :top, :bottom, :extra
@lostmarinero
lostmarinero / causes_challenges.rb
Created January 14, 2014 18:39
This is the 10 questions given by Causes - Target Time 20 Minutes
def problem_1(input_string)
arr = input_string.split(" ")
arr.reverse!
arr.join(" ")
end
puts "#############################"
Questions THEIR LIFE EXPERIENCES
-Pick an experience from your own life and explain how it has influenced your development as a person.
- Describe your most meaningful achievement that has made a difference in your community
- What have you learned from someone who is very different from you?
- tell me in 200 words how you would utilize your experience at dev bootcamp to give back to individual from your community that are interested in a development bootcamp?