Skip to content

Instantly share code, notes, and snippets.

View greglinch's full-sized avatar

Greg Linch greglinch

View GitHub Profile
@stevenrich-zz
stevenrich-zz / 278requests.py
Created April 1, 2017 00:39
Automating Personal Financial Disclosure requests to White House
import csv, time
from selenium import webdriver
from selenium.webdriver.support.ui import Select
from selenium.webdriver.common.keys import Keys
applicant_name = # your name
applicant_email = # your email
applicant_address = # your physical address
occupation = # your occupation
@sandeepraju
sandeepraju / ttfb.sh
Created July 20, 2016 21:17
curl command to check the time to first byte
#!/bin/bash
# file: ttfb.sh
# curl command to check the time to first byte
# ** usage **
# 1. ./ttfb.sh "https://google.com"
# 2. seq 10 | xargs -Iz ./ttfb.sh "https://google.com"
curl -o /dev/null \
-H 'Cache-Control: no-cache' \
-s \
@davisshaver
davisshaver / analyst.md
Last active December 1, 2016 05:53
Philadelphia Media Network Analytics Team - Interview Questions

Analyst Interview Questions

A collection of questions we typically ask job applicants during analyst interviews.

Scenario

The date is January 4. You are well rested after a festive holiday season. 🎉

We're gearing up to launch a new product, and we need your help.

Let's begin.

@akanik
akanik / excel-csv.py
Last active May 15, 2018 15:26
excel sheets to individual csv files
# Thanks to http://stackoverflow.com/questions/9884353/xls-to-csv-convertor
import os, csv, xlrd
excel_file = '/path/to/file.xls'
#we're specifying a directory here because we'll have several files
#be sure to include end slash
csv_filepath = 'path/to/csv/directory/'
def csv_from_excel(excel_file):
workbook = xlrd.open_workbook(excel_file)
@achavez
achavez / README.md
Last active July 11, 2019 14:52
Development machine setup

Prerequisites

  1. Run all of the OS updates that are available
  2. Install Homebrew and tap the casks we'll need (brew tap homebrew/cask-fonts, brew tap homebrew/cask-versions)

Shell setup

  • install ZSH - brew install zsh
  • set ZSH as the default shell by 1) adding the output of which zsh to /etc/shells and 2) changing the default shell with chsh -s $(which zsh)
  • add autocompletion to ZSH brew install zsh-autosuggestions (be sure to follow the instructions output by brew to update your ~/.zshrc)
  • later, after installing Node install a cool command prompt like spaceship (more here) - npm install -g spaceship-prompt
@davisshaver
davisshaver / engineer.md
Last active October 29, 2015 20:26
Philadelphia Media Network – Tech/Product Jobs

The Philadelphia Media Network is seeking engineers to join a new development team within its Systems division. As an early engineering hire on this team, you will have a large role in shaping its culture, values, and workflow.

Engineer

Interested? Email us.

The technical stuff:

  • Rails experience would be great, but at least you should be willing to learn. We will be maintaining and enhancing a Rails CMS built to manage our new mobile app. Don’t worry though, you will be inheriting a stable, well-documented, and test-driven project.
  • “Fullstack” projects should be comfortable to you. We want engineers who are interested in the entire product development process – understanding needs, vetting technical approaches, planning work to be done, and engineering in an agile manner. Learning and problem solving are two of your favorite things to do.
  • Git, unit tests, and coding standards are all familiar to you, and you understand why we practice
@stucka
stucka / AP date formatting.txt
Last active September 9, 2017 19:33
AP style date fixes for MySQL and Python
Code base has been moved to https://github.com/PalmBeachPost/APdates
@eyeseast
eyeseast / apdate.js
Created May 12, 2015 21:55
Format a date in AP style
function apDate(date) {
var months = ['Jan.', 'Feb.', 'March', 'April', 'May', 'June', 'July', 'Aug.', 'Sept.', 'Oct.', 'Nov.', 'Dec.'];
return months[date.getMonth()] + ' ' + date.getDate() + ', ' + date.getFullYear();
}
@eyeseast
eyeseast / install.md
Last active September 20, 2015 01:17
Starting software for a programmer-journalist
@nickjevershed
nickjevershed / google-sheets-json.py
Last active October 7, 2023 03:18
Python script to convert Google spreadsheets to simple JSON file and save it locally. Assumes your data is on the left-most sheet, ie the default. Spreadsheet needs to be 'published to the web'.
import simplejson as json
import requests
#your spreadsheet key here. I'm using an example from the Victorian election campaign
key = "1THJ6MgfEk-1egiPFeDuvs4qEi02xTpz4fq9RtO7GijQ"
#google api request urls - I'm doing the first one just to get nice key values (there's probably a better way to do this)
url1 = "https://spreadsheets.google.com/feeds/cells/" + key + "/od6/public/values?alt=json"