Skip to content

Instantly share code, notes, and snippets.

View parkerl's full-sized avatar

Lew Parker parkerl

  • Rxrevu Inc.
  • Denver, CO, USA
View GitHub Profile
[{
"insurancepolicyholdercountrycode": "USA",
"sequencenumber": 1,
"insuranceplanname": "BCBS-CO: ANTHEM BCBS OF CO",
"insurancetype": "Group Policy",
"insurancepolicyholderlastname": "MAGEE",
"insurancephone": "(888) 817-3717",
"insurancepackagestate": "CO",
"insurancepackagecity": "DENVER",
"insuredentitytypeid": 1,
[{
"patientid": "37651"
}]
@parkerl
parkerl / gist:d0205eb0be9a5feb0eb6f2934c4fa9ed
Last active July 19, 2019 20:04
Insurance plan response
{
"insurances": [{
"affiliations": ["Anthem", "WellPoint"],
"insuranceplanname": "BCBS-CO: ANTHEM BCBS OF CO",
"insurancepackageid": 12059,
"addresslist": ["PO BOX 5747 DENVER CO 80217-5747"]
}, {
"affiliations": ["Anthem", "Taft Hartley", "WellPoint"],
"insuranceplanname": "BCBS-CT: ANTHEM BCBS",
"insurancepackageid": 2559,
@parkerl
parkerl / where_error.exs
Last active October 21, 2015 18:53
error
defp escape(expr, type, params, binding, env) when is_list(expr) do
{parts, params} =
Enum.map_reduce(expr, %{}, fn {field, value}, acc ->
{value, params} = Builder.escape(value, {0, field}, acc, binding, env)
{{:==, [], [to_field(field), value]}, params}
end)
IO.inspect parts
expr = Enum.reduce parts, &{:and, [], [&1, &2]}
{expr, params}
@parkerl
parkerl / gist:557ccc9f5bf23ab5b589
Last active August 29, 2015 14:21
poolboy error
± > mix deps.compile -I-
Uncaught error in rebar_core: {'EXIT',
{badarg,
[{re,split,
[[118,99,115,95,105,110,102,111,95,109,115,
103,95,48,95,61,40,37,70,123,99,121,97,
110,125,109,97,115,116,101,114,37,123,27,
91,51,52,109,37,125,64,37,70,123,121,101,
108,108,111,119,125,57,50,98,49,100,48,51,
37,102,37,70,123,114,101,100,125,9679,37,
┌────────────────────────────┐
│ Trips │ ┌────────────────────────────┐
│ - Start Date │ │ Fishermen │
│ - End Date │╲ ╱│ - Name │
│ │────────────────│ - Date of Birth │
│ │╱ ╲│ │
│ │ └────────────────────────────┘
└────────────────────────────┘ ┼
@parkerl
parkerl / legacy_code_14_to_17.md
Last active August 29, 2015 14:01
Working Effectively with Legacy Code: Chapters 14 to 17

###Chapter 14: Dependencies on Libraries Are Killing Me###

  • Avoid promiscuously calling on libraries throughout your code. (ActiveRecord??)
  • “Every hard-coded use of a library class is a place where you could have had a seam.”
  • Is there any relevance for the language feature enforced design constraints in Ruby? Objective-C?

###Chapter 15: My Application Is All API Calls###

  • Don't test if your app is all API calls?
  • ActiveRecord must be one the best tested libraries in existence

As with most programming answers...it depends.

The command /bin/rails explicitly runs the rails command found in your system's /bin direcory.

The command rails causes bash to look in the directories listed in the special evironment variable $PATH for the first command named "rails" that it finds. The directory bin is usually in your $PATH and if the system finds the rails command there the /bin/rails and rails execute the same command.

If however, you happen to have another version of rails installed somewhere like /usr/bin/rails and that is in your $PATH first then rails might run that. In this case tehre might be a world of difference as the two commands could run diffrent versions of rails.

In general, unless you are explicitly trying to run a different version of rails than the one in your $PATH, it is best to call just rails g blah as that is the one your system "assumes" to be the right one.

#Lew's Opinionated Guide to Delivering Features#


  1. First, understand the story.

Do you understand the story completely? If not, talk to the product owner to clarify your understanding.

Is the story a logically cohesive grouping of functionality? If not, can it be broken into multiple stories?

Do the points assigned make sense given your current level of understanding of the story? If not, can it be broken into multiple stories?

@parkerl
parkerl / extract_and_download_images_from_css.md
Created February 8, 2012 18:31
Extract image URLs from a CSS file and download them onto a new server (Linux)

#Extract Image URLs and WGet Them to a New Server#

This was a fun problem. I needed to move all the images referenced in a CSS file to another server. I didn't want to just grab all the image files as there were a bunch I didn't need. Here is how I went about it. I am sure you could do it in one step but doing it this way gives you a chance to check for errors.

First you may want to use wget http://otherserver/the_css.css to pull the CSS file on to the target server if it is still on the old server as it was in my case.

  1. User grep to extract the URLs from the css file into another file. (You may need to adjust the regular expression if you have funny characters in your file names) Note the use of the -o flag that tells grep to only print out that part of the line that matches the expression rather than the entire line.

     grep -o '\/path\/to\/files\/[a-zA-Z0-9/.:_-]*' the_css.css > images.txt