Skip to content

Instantly share code, notes, and snippets.

@freejoe76
freejoe76 / nbc-news-data-graphics-intern.md
Last active April 16, 2024 20:47
NBC News Data / Graphics internship

NBC News Data Graphics team intern

The Data/Graphics team at NBC News is responsible for explaining the news through visualizations and data analysis.

We build interactives, charts, maps, illustrations, graphics and more to tell the news in a compelling and thoughtful way. See our recent work: https://www.nbcnews.com/datagraphics

The intern should be interested in data visualizations and be an avid news reader. They should have an interest in data journalism and will help find stories that we could be telling in a new and visual way. They will also help create charts, maps and graphics for breaking news stories and for reported features.

Note that this internship is only available to those who will be current students at the time of the internship.

@freejoe76
freejoe76 / example.bash
Last active December 12, 2023 01:40
Install multiple versions of python on debian / ubuntu server
# Find the URL of the python you want here: https://www.python.org/downloads/source/ , you're looking for the "Gzipped source tarball" link of the version you want.
# We're doing 3.10 here for this example.
wget https://www.python.org/ftp/python/3.10.13/Python-3.10.13.tgz
tar -xf Python-3.10.13.tgz && cd Python-3.10.13
./configure --enable-optimizations
make && sudo make altinstall
# This won't override an existing python3 – it creates a python3.10 executable.
@freejoe76
freejoe76 / _PYTHON-BOILERPLATE-README.md
Last active June 2, 2021 02:52
My python boilerplate

These files, as written, are aimed at command-line execution, but because if __name__ == '__main__': only fires when run on the command line, it can also be included in another python script if need be.

It uses doctests (which fire when run from the command line with a -t / --test flag) because I like doctests because they're the simplest way to add tests to your code, and tests in your code are a good way to help remind future-you how current-you imagined you'd be using the code you wrote.

The code you want to execute goes in the main() method.

A roundup of what the news nerds slack suggested for a reporter who was looking to up their data skills.

This is what I asked:

I had a question from a business reporter who was looking to up their data game in their own time, was thinking of either doing Python / PANDAS, or R, or maybe just upping their Excel skills. They're interested in learning how to do data exploration and maybe a little bit of scraping. They asked me for where to go to learn this and I didn't have a lot of good answers -- thought I'd ask here what people who have done the same thing can recommend.

And these are the responses:

Julia Wolfe

I did the coursera john hopkins data science program, it taught me R and helped give me a foundational introduction to data science, but that was a pretty decent time investment, so obviously not right for everyone

#!/usr/bin/bash
URL='https://www.justice.gov/storage/report.pdf'
while [ True ]; do
RANDO=$(openssl rand -base64 40 | tr -dc 'a-zA-Z'; openssl rand -base64 40 | tr -dc 'a-zA-Z')
wget -O full-mueller-report.pdf "$URL?$RANDO"
if [[ $? -ne 8 ]]; then
# Upload it to wherever it belongs
say "We've got it"
break;
fi

Keybase proof

I hereby claim:

  • I am freejoe76 on github.
  • I am person09520 (https://keybase.io/person09520) on keybase.
  • I have a public key whose fingerprint is 7BE1 F63C 28C3 7A28 64E8 042B C6D2 2066 83F1 7FB0

To claim this, I am signing this object:

yessssssssss

:%s#<h2>\([^<]\+\)#<img src="assets/" alt="\1">\r<hr>\r<h2>\1#g

Csvkit intro

A walk-through on slimming down a CSV, getting some information about its fields, slimming down the columns we're working with and pulling information about those columns.

https://csvkit.readthedocs.io/en/1.0.2/scripts/csvcut.html

High-level look at the spreadsheet

Csvkit can work slow on large CSVs, so for the sake of this walk-through we're going to work with 5,000 rows of the CSV.

@freejoe76
freejoe76 / table.html
Last active October 30, 2018 22:01
Semantic, accessible markup examples. More about table accessibility: https://webaim.org/techniques/tables/data
<table>
<caption>Country populations, 2018</caption>
<thead>
<tr>
<th scope="col" abbr="">Country</th>
<th scope="col" abbr="">Population</th>
</tr>
</thead>
<tbody>
<tr>