Skip to content

Instantly share code, notes, and snippets.

View skorasaurus's full-sized avatar

Will Skora skorasaurus

View GitHub Profile
@davewarfel
davewarfel / default-wordpress-blocks-sass.scss
Last active November 8, 2023 11:31
WordPress Blocks Styles - Cleaned Up, Commented & Sassified
/**
* WordPress Blocks
*
* Default block styling included with WordPress core.
* Provides a better starting point for WordPress theme developers,
* especially when using Sass.
*
* @link https://github.com/WordPress/WordPress/blob/master/wp-includes/css/dist/block-library/style.css
*
* Most styles from the above file are included.

Geojson.net

Geojson.net will be a replacement for geojson.io, the simple editor for map data. In most ways, it has the same intent, goals, limitations, and ideas of geojson.io - they're both projects of mine.

I created geojson.io as a side project in 2013, and it thrived for a few years, as it simply solved the problem of previewing, modifying, and creating map data. I think it benefited from simplicity and unity of thought: it wasn't a product, it didn't have overarching design goals or any sort of leadership. There was the core functionality, and a bunch of functionality that pretty neatly layered on top of that without making the whole thing too intimidating. I'm pretty happy with how it went.

Over the last two or so years, though, geojson.io hasn't changed much, and the web has. Which means that, in a few ways, it's just straight-up broken: GitHub integration is broken, it was never updated to accommodate for the deprecation of anonymous gists, and

@tomkeays
tomkeays / responsive-youtube.html
Created February 16, 2018 22:26
Responsive YouTube Snippet
<style>
.videoWrapper {
position: relative;
padding-bottom: 56.25%; /* 16:9 */
padding-top: 25px;
height: 0;
}
.videoWrapper iframe {
position: absolute;
@etachov
etachov / national_parks_squared.R
Last active January 10, 2018 05:40
Make a square-looking map of U.S. National Parks
# load libraries
library(tidyverse)
library(rgdal)
# get state data
states_map <- map_data("state") %>%
# use round to create square border
mutate_at(.funs = funs(round), .vars = vars(long, lat))
# get park data from https://catalog.data.gov/dataset/national-park-boundariesf0a4c
@GaryJones
GaryJones / notes.md
Last active October 24, 2023 19:12
Add PHPCS + WPCS to Sublime Text 3

Install PHP_CodeSniffer (PHPCS) via git

You can use the .phar for PHPCS, but it's easier to pull the repo down from git to then choose what version to use.

cd ~
mkdir -p code
cd code
git clone https://github.com/squizlabs/PHP_CodeSniffer.git phpcs
// This would be a kind of "code of conduct" or "statement of values" cities would prescribe for potential govtech startup vendors.
// VERY DRAFT & UNOFFICAL
- *Citizen-first experience*: In the private sector, simple, beautiful, and easy to use technology has become commonplace -- and that’s happened because user-centric technologists have prioritized user needs and experiences. The city expects the same for the citizen experience: seamless, smart, and accessible.
- *For (All) the People*: The City doesn’t have the luxury of catering to one demographic; our technology must work for any affected resident, no matter ethnicity, access to technology, gender, etc. Government technology must have a bias towards all.
- *Built to scale*: The City prioritizes software-as-a-service technologies that not only can solve a problem locally but also scale nationally, and with that national reach continually deliver better and better product for citizens.
- *Default to open*: Any technology put in place will generate massi
@montanaflynn
montanaflynn / CONCURRENCY.md
Last active November 7, 2024 18:22
Examples of sequential, concurrent and parallel requests in node.js

Concurrency in JavaScript

Javascript is a programming language with a peculiar twist. Its event driven model means that nothing blocks and everything runs concurrently. This is not to be confused with the same type of concurrency as running in parallel on multiple cores. Javascript is single threaded so each program runs on a single core yet every line of code executes without waiting for anything to return. This sounds weird but it's true. If you want to have any type of sequential ordering you can use events, callbacks, or as of late promises.

@jsanz
jsanz / README.md
Last active May 17, 2018 13:53
Geocode with Mapzen search and Google Spreadsheets

How to set up a quick geocoding system on google spreadsheets.

  1. Create a new spreadsheet
  2. Open the Scripts editor and paste the script attached
  3. Use on your spreadsheet this new formula
=searchMapzen(place_cell,mapzen_api_key)

@chriswhong
chriswhong / readme.md
Last active September 8, 2019 12:03
Run open trip planner docker container for NYC

This set of commands is for setting up an open trip planner instance for New York City. OTP requires GTFS data and OSM streets data to build a graph, which it uses for trip planning.

Lucky for us, someone here dockerhub has left a nice CLI command to build the graph and run the container, but we need to get the data first.

The data are downloaded on the host machine. For me, this is a digitalocean droplet running ubuntu 14.

First, get GTFS for the New York City Subway from the MTA's downloads page: wget http://web.mta.info/developers/data/nyct/subway/google_transit.zip Next, get OSM city extract for NYC. Thanks Mapzen! https://s3.amazonaws.com/metro-extracts.mapzen.com/new-york_new-york.osm.pbf

Finally, run the following docker command: docker run -it -v $(pwd):/var/otp/graphs opentripplanner/opentripplanner --build /var/otp/graphs --analyst

@rcackermanCC
rcackermanCC / sub_messy_names.py
Created June 22, 2016 20:13
Clean weekday names
def clean_words(text):
weekdays = {'sunday': {'pattern': r'\b(su.*?(n|y))(\W|\s|\b)',
'replacement': r'sunday\3'},
'monday': {'pattern': r'((mo.*?(n|y)(?:s)*)|m)(\W|\s|\b)',
'replacement': r'monday\4'},
'tuesday': {'pattern': r'\b(t(u|y).*?(e|s|y)(?:s)*|t)(\W|\s|\b)',
'replacement': r'tuesday\4'},
'wednesday': {'pattern': r'\b(w|w.*?d(.*?|s|y|t)(?:s)*)(\W|\s|\b)',
'replacement': r'wednesday\3'},
'thursday': {'pattern': r'\b(th|th[a-z]*?(r|s|y|t)(?:s)*)(\W|\s|\b)',