Skip to content

Instantly share code, notes, and snippets.

View easherma's full-sized avatar
👋

Eric Sherman easherma

👋
View GitHub Profile
var format = "0xxx xxx xxxx";
var numbers = Math.random().toFixed(10).split('.')[1]
for(var i = 0; i < numbers.length; i++)
{
format = format.replace('x', numbers[i]);
}
return format;
@easherma
easherma / generate_factories.py
Created April 16, 2021 20:03 — forked from vkurup/generate_factories.py
Django management command to generate factory-boy boilerplate factory definitions for all the models in a given app. The code is not intended to be usable right off the bat, it just provides a few sane defaults based on the structure of your models.
from django.core.management.base import BaseCommand
from django.db.models import fields
from django.db.models.fields import related
from django.apps import apps
class Command(BaseCommand):
help = """Generate factory-boy factories for the given app"""
def add_arguments(self, parser):
@easherma
easherma / foss4gtalks.md
Created January 17, 2018 19:39
FOSS4GNA talk submissions
  • IDOT/ILSOY partnership, using crowd sources mapping for planners, leveraging OS GIS to keep costs low and engagment high
  • Chi Hack Night/CFA stuff (and mapping?)
  • City Bureau projects (civic journalism, data, and mapping; a look at lead, NW side community planning; TIF maps)
  • Map My Story
@easherma
easherma / did_i_do_that.md
Last active January 23, 2018 16:57
Did I Do That?

Did I do that?

Problem

Reduplication of work is very common in both the civic tech and open source space.

For lots of reasons (expand).

To address this, in the community it is often proposed to have a list of resources or existing projects. While an obvious solution, it has several fundamental challenges, such as:

  • It is hard for one or a small group of people to know everything that is going on
  • Someone has to maintain this resource or else relevance slowly declines and leads to stagnation
@easherma
easherma / vuecomponent
Created April 10, 2017 19:58
example vuechart
<script>
import Highcharts from 'highcharts'
import jquery from 'jquery'
export default {
data () {
return {
data: [
['DE.SH', 728],
@easherma
easherma / map_data_2014.geojson
Created March 28, 2017 17:27
hrmis geojson example
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@easherma
easherma / map_style.js
Last active March 28, 2017 17:13
color bins for HRIMS
function style_map(feature) {
if (feature.properties['re_over_te'] >= 0.006980 && feature.properties['re_over_te'] <= 0.068916 ) {
return {
pane: 'states_data',
opacity: 1,
color: '#000000',
dashArray: '',
lineCap: 'butt',
lineJoin: 'miter',
weight: 1.0,
class Story(models.Model):
story_name = models.CharField(max_length=200)
story_description = models.TextField()
story_instructions = models.TextField()
class User(models.Model):
story_id = models.ForeignKey(Story)
user_name = models.CharField(max_length=200)
user_email = models.EmailField(max_length=254)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
{
"type": "FeatureCollection",
"features[0][0].type": "Feature",
"features[0][0].properties.response": "{\"address\":\"5125 Trillium Blvd\",\"category_ids\":[9],\"category_labels\":[[\"Automotive\",\"Maintenance and Repair\"]],\"country\":\"us\",\"factual_id\":\"20040056-f5f2-4cf2-ace9-1f51e98cd0c7\",\"hours\":{\"tuesday\":[[\"9:00\",\"17:00\"]],\"friday\":[[\"9:00\",\"17:00\"]],\"thursday\":[[\"9:00\",\"17:00\"]],\"wednesday\":[[\"9:00\",\"17:00\"]],\"monday\":[[\"9:00\",\"17:00\"]]},\"hours_display\":\"Mon-Fri 9:00 AM-5:00 PM\",\"latitude\":42.07869,\"locality\":\"Hoffman Estates\",\"longitude\":-88.209363,\"name\":\"I-Car\",\"postcode\":\"60192\",\"region\":\"IL\",\"tel\":\"(847) 590-1198\",\"website\":\"http://www.i-car.com/\"}",
"features[0][0].geometry.type": "Point",
"features[0][0].geometry.coordinates[0]": -88.209363,
"features[0][0].geometry.coordinates[1]": 42.07869,
"features[0][1].type": "Feature",
"features[0][1].properties.response": "{\"address\":\"5150 Prairie Stone Pkwy\",\"category_