Skip to content

Instantly share code, notes, and snippets.

@vykster
vykster / gist:10812612
Created April 16, 2014 05:45
Tips and Tutorials for Learning to Code
@vykster
vykster / split_counties.sh
Created August 28, 2014 20:05
split counties
#!bin/bash
for f in v1-*
do
x=$(echo $f | tr '[:upper:]' '[:lower:]' | sed 's/v1-//g' | sed 's/\.csv//g')
echo "Processing $x"
mkdir $x
mkdir $x/2014-06-02
mv $f $x/2014-06-02/v1
done
@vykster
vykster / copy_mapper.rb
Created November 6, 2014 22:53
copy mapper from Gavin
# Note this needs to be mapper_id, not import_file_id
MAPPER_TO_COPY = Mapper::Base.find(_ID_)
fipz = FipsCode.where(state: '_STATE_').where("county is not null").pluck(:id)
files = ImportFile::Voter.where(fips_code_id: fipz)
files.each do |file|
new_mapper = MAPPER_TO_COPY.copy
new_mapper.fips_code_id = file.fips_code_id
Run counts on production database,
group by districts, fips (state? or county?)
## Political Info
'party'
'registered_at'
'is_active_voter'
'is_perm_absentee'
## District Info
@vykster
vykster / society-talk.md
Last active March 2, 2022 18:46
Resource links for Society 4.0 talk