Skip to content

Instantly share code, notes, and snippets.

attach(ufa)
ufa_subset<-ufa[c("X","Y","FACILITYID","VICINITY","TBOX_L","TBOX_W","TBOX_STAT","SCI_NM","CMMN_NM","DATE_PLANT","DBH")]
ufa_subset$FACILITYID <- gsub("-","",ufa_subset$FACILITYID)
ufa_subset$TBOX_STAT <- ufa_subset$TBOX_STAT=="Plant"
ufa_subset$DATE_PLANT <- sub("T.*","",ufa_subset$DATE_PLANT)
ufa_subset$Other <- as.character(lapply(strsplit(as.character(SCI_NM), split=" x "), "[", 1))
ufa_subset$Cultivar <- as.character(lapply(strsplit(as.character(SCI_NM), split=" x "), "[", 2))

Get the word out about your Code for DC projects and solicit feedback from relevant communities, people, and organizations. This is not intended to be an exhaustive list, but instead should highlight contacts that you have found to be responsive. Information can go one or more category. Just place it where you think it is most relevant (i.e. a ward education council might go under the 'education' category, rather than one for its ward, since it is focused on education issues).

Local DC Government

@emanuelfeld
emanuelfeld / allKeys.js
Created August 22, 2015 02:03
Node.js script for creating an array of all unique keys in an array of Javascript objects.
var _ = require('underscore')
function allKeys (In, Out) {
for (var i = 0; i < In.length; i++) {
var fieldArray = Object.keys(In[i])
if (!(Out.some(function (b) { return _.isEqual(fieldArray, b)}))) {
Out.push(fieldArray)
}
}
var OutCombined = _.reduce(Out, function(a, b) { return a.concat(b); }, []);
@emanuelfeld
emanuelfeld / civic.json
Last active January 19, 2016 18:46
Working proposal for DCgov-Code for DC civic.json standard
{
"specification": "",
"status": "",
"name": "",
"description": "",
"thumbnailUrl": "",
"contact": {
"name": "",
"email": "",
"twitter": "",
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "civic.json extended",
"type": "object",
"definitions": {
"participants": {
"type": "object",
"properties": {
"name": {
"type": "string"
@emanuelfeld
emanuelfeld / digdc_api.md
Last active September 14, 2017 03:31
How to use the DC Public Library's DigDC API Raw

DigDC API Documentation

DigDC is the web home for the DC Public Library's Special Collections. It hosts historical cartoons, photographs, maps, oral histories, postcards, and other ephemera.

Get a list of the collections

Endpoint:

https://server16808.contentdm.oclc.org/dmwebservices/index.php?q=dmGetCollectionList/json
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@emanuelfeld
emanuelfeld / 6-01_slab2.ipynb
Created July 8, 2016 03:33
MIT 6.01 State Machines
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@emanuelfeld
emanuelfeld / gi-lf
Last active April 24, 2017 14:26
as pre-commit script, automatically add files larger than some size to your repository's .git/info/exclude file
#!/bin/bash
# set max file size to include (in MB)
max_size_mb=100
max_size_b="$(($max_size_mb * 1000000))c"
git_dir="$(git rev-parse --show-toplevel)"
git_exclude=$git_dir/.git/info/exclude
files="$(find $git_dir -path $git_dir/.git -prune -o -type f -size +$max_size_b -print | sed "s%$git_dir/%%g" | sed "s/\ /\\\ /g")"