Skip to content

Instantly share code, notes, and snippets.

@mapsam
mapsam / locations.geojson
Last active August 29, 2015 14:24
ABQ Voting Locations
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mapsam
mapsam / flip.sql
Created June 2, 2015 22:52
abq_sql_tableflip
SELECT
zip_codes,
SUM (case WHEN type = 'jobs' THEN cnt ELSE 0 END) AS jobs,
SUM (case WHEN type = 'education' THEN cnt ELSE 0 END) AS education,
SUM (case WHEN type = 'housing' THEN cnt ELSE 0 END) AS housing,
SUM (case WHEN type = 'childcare' THEN cnt ELSE 0 END) AS childcare,
SUM (case WHEN type = 'transportation' THEN cnt ELSE 0 END) AS transportation,
SUM (case WHEN type = 'health' THEN cnt ELSE 0 END) AS health,
SUM (case WHEN type = 'grants' THEN cnt ELSE 0 END) AS grants,
SUM (case WHEN type = 'food' THEN cnt ELSE 0 END) AS food
@mapsam
mapsam / bugs.md
Last active August 29, 2015 14:21
bugs

Navigation Bar

  • "SCREENER" title on navigation doesn't link to anything. What should we link to? Or should we remove the link?
  • "Browse Patients" doesn't specify "your patients" or "new patients" - is this confusing?

Prescreener

  • /preescreening_basic/ only shows "Access Now" at the top. Probably hard coded right now, but may be confusing to user when doing multiple screenings or a different service.
  • /prescreening_results/ when "negative" shows a cryptic phrase without the name of the clinic and an empty period at the end of the sentence.
  • If you prescreen and submit without entering anything in the fields, you get a 400 bad request error.
@mapsam
mapsam / __init__.py
Created May 1, 2015 05:25
copy directory in flask
import shutil
def copyDirectory(src, dest):
try:
shutil.copytree(src, dest)
# Directories are the same
except shutil.Error as e:
print('Directory not copied. Error: %s' % e)
# Any error saying that the directory doesn't exist
except OSError as e:
@mapsam
mapsam / README.md
Last active June 11, 2023 11:59
Namecheap > Github pages

Namecheap > Github pages

Pointing your domains to a gh-pages branch requires three steps.

  1. Add the Github IPs as A records on Namecheap.
    185.199.108.153
    185.199.109.153
    185.199.110.153
    185.199.111.153
@mapsam
mapsam / east.geojson
Created April 15, 2015 01:18
feature files
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Here are some really shotty install instructions.

pip install virutalenv
pip install virtualenvwrapper
brew install mysql

git clone [email protected]:codeforamerica/rva-screening.git
cd rva-screening
source ~/.base_profile
mkvirtualenv rva-screening
@mapsam
mapsam / tinatimes.md
Last active August 29, 2015 14:17
Tina times circles

Homepage & Sidebar

There are two unique instances where featured images are shown in this theme. The first is a bit more simple since the theme loads the square formatted images. These can be properly "circled" with the following added to the style.css:

.type-post.has-post-thumbnail > a {
  line-height: 0;
  overflow: hidden;
  border-radius: 50%;
}
@mapsam
mapsam / drive.md
Created March 17, 2015 17:13
Drive Reorganization for Team RVA

Here's a first crack at re-organizing the Drive. Thinking we have three buckets:

  1. Admin
  2. Projects/Research
  3. Notes/Meetings

What do you think? Probably requires a few currently existing folders to be renamed. The goal is to start putting some of our research into project-specific folders so we can have it all in one place. That's what makes sense to me, but if it doesn't to you this is definitely open for critique!

Team Admin * 
@mapsam
mapsam / this.md
Last active August 29, 2015 14:17
_this = this vs. .bind(this)

Some recent work has pushed me into scoping my javascript more consciously. There is a lot of usage of this on a local level that can make things all sorts of confusing. There are multiple avenues to properly scope your javascript through your functions, but keeping this scoped properly to use in other scopes gets complicated. I use two different methods and am unsure which is best:

assigning to a new variable

Can now be used inside other functions as _this when you also need the specific function's this scope.

var _this = this;

using .bind(this)