Skip to content

Instantly share code, notes, and snippets.

View packeted's full-sized avatar

Francis Wong packeted

View GitHub Profile
@dannguyen
dannguyen / faa-333-pdf-gathering.md
Last active June 19, 2021 13:18
Using wget + grep to explore inconveniently organized federal data (FAA Section 333 Exemptions)

if !database: wget + grep

The Federal Aviation Administration is posting PDFs of the Section 333 exemptions that it grants, i.e. the exemptions for operators who want to fly drones commercially before the FAA finishes its rulemaking. A journalist wanted to look for exemptions granted to operators in a given U.S. state. But the FAA doesn't appear to have an easy-to-read data file to use and doesn't otherwise list exemptions by location of operator.

However, since their exemptions page is just one giant HTML table for listing the PDFs, we can just use wget to fetch all the PDFs, run pdftotext on each file, and then [grep](https://medium.com/@rualthanzauva/grep-was-a-private-command-of-m

@tweeeety
tweeeety / mongodb_script_insert_act_log_sample.js
Created April 28, 2014 06:09
mongo script for insert 100 million test data
// sample persons
var persons = {
"id01" : { "name": "hoge", "act_num": 1000} // 100件
,"id02" : { "name": "piyo", "act_num": 256489} // 256,489件
,"id03" : { "name": "huga", "act_num": 33325482} // 33,325,482件
,"id04" : { "name": "mone", "act_num": 59784816} // 59,784,816件
,"id05" : { "name": "tako", "act_num": 20} // 20件
,"id06" : { "name": "nasu", "act_num": 23658} // 23,658件
,"id07" : { "name": "poke", "act_num": 1578411} // 1,578,411件
,"id08" : { "name": "paca", "act_num": 985824} // 985,824件
@asizer
asizer / README.md
Last active November 8, 2019 07:37
d3 Horizontal BoxPlot

This sample is based on Mike Bostock's Box Plots. The box.js file has been modified in a number of ways besides making the box plots horizontal: the transitions have been removed, the 1.5 iqr function is included as the default to compute the whisker length, data objects are attached to the whisker ends and outlier dots (instead of just the values), and there are transparent q1-q2 and q2-q3 boxes that contain those respective data points for possible future use.

Hovering over outlier dots in the boxplot highlights them on the table and vice-versa. This also demonstrates a move-to-front functionality -- when an outlier circle is highlighted, it is moved to the end of the svg's elements so that it appears on top of the other outliers.

Also, the axis rounds its range to intervals that go into a power of 10 (see the cleanUpChartRange function).

The variable being plotted is a generated logNoraml distribution, to demonstrate outliers more prominently (sometimes there are so many, the table gets cut

@mislav
mislav / pagination.md
Created October 12, 2010 17:20
"Pagination 101" by Faruk Ateş

Pagination 101

Article by Faruk Ateş, [originally on KuraFire.net][original] which is currently down

One of the most commonly overlooked and under-refined elements of a website is its pagination controls. In many cases, these are treated as an afterthought. I rarely come across a website that has decent pagination, and it always makes me wonder why so few manage to get it right. After all, I'd say that pagination is pretty easy to get right. Alas, that doesn't seem the case, so after encouragement from Chris Messina on Flickr I decided to write my Pagination 101, hopefully it'll give you some clues as to what makes good pagination.

Before going into analyzing good and bad pagination, I want to explain just what I consider to be pagination: Pagination is any kind of control system that lets the user browse through pages of search results, archives, or any other kind of continued content. Search results are the o