Skip to content

Instantly share code, notes, and snippets.

View atestu's full-sized avatar

Alexandre Testu atestu

View GitHub Profile
@atestu
atestu / Questions.md
Last active November 2, 2015 14:43
NYT asks: How do you hire?

Mary Laschinger of Veritiv Are they a team player? Are they an egomaniac? Are they here to help the enterprise succeed? Will they help their colleagues succeed? Or is it just about them and their team?

Jan Singer from Spanx How have you built teams? What frustrates you? What happens when you get frustrated? What was the biggest mistake you made and what happened after? How did you respond?

@atestu
atestu / get_sheet.php
Last active September 24, 2017 07:07
Use Google Sheets as a micro CMS in PHP
<?php
// based on http://sim.plified.com/2008/09/14/accessing-google-spreadsheet-with-php/
function cbi_get_spreadsheet ($key) {
$url = "http://spreadsheets.google.com/feeds/cells/$key/1/public/values";
$ch = curl_init();
// set URL and other appropriate options
curl_setopt($ch, CURLOPT_URL, $url);
@atestu
atestu / Gruntfile.js
Last active August 29, 2015 13:59
Simple LESS Gruntfile.js
'use strict';
module.exports = function (grunt) {
// load all grunt tasks
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.initConfig({
watch: {
// if any .less file changes in directory "public/css/" run the "less"-task.

I was reading this article on FiveThirtyEight and was a little shocked at the high homicide rate in Guatemala for the simple reason that I'm going there on a vacation in a couple of weeks. I also noticed, unsurprisingly, that homicides are much more common in poorer countries so I made these charts:

Linear chart

Logarithmic chart

I urge you to also check out the table below. As you can see, it's not as simple as "poor → homicides"…

The chart was made in Numbers and is very similar to my previous one on gay acceptance.

@atestu
atestu / README.md
Last active August 29, 2015 13:58
Acceptance of homosexuality vs. GDP per capita

The Pew Research Center global a survey about homosexuality last year. They asked the question "Should society accept homosexuality?"* I substracted the no's from the yes' to calculate what I call the acceptance rate.

I compared that acceptance rate to GDP per capita and found some interesting results. I'll let you make your own conclusions.

The chart was made in Numbers.

* It is important to note that this is not a survey about particular gay rights like same sex marriage, it is simply asking whether we should accept homosexuality or not.

@atestu
atestu / index.js
Created March 21, 2014 15:05
bar chart editor step 1
// all of these variables are independent of the data,
// so we exclude them from the draw function
var margin = {top: 20, right: 30, bottom: 30, left: 40},
width = 960 - margin.left - margin.right,
height = 500 - margin.top - margin.bottom;
var x = d3.scale.ordinal()
.rangeRoundBands([0, width], .1);
var y = d3.scale.linear()
@atestu
atestu / README.mdown
Last active May 15, 2016 01:17 — forked from mbostock/.block
Let's make a bar chart... editor!

Let's make a bar chart... editor!

I'm a front end engineer at CB Insights. We use d3.js for almost all our visualizations, from simple bar and line charts to complex network graphs.

I wanted to share some of what I've learned but I didn't know where to start. There are a ton of d3 tutorials for newbies out there and I didn't feel like I would be able to add anything new. But after reading Mike Bostock's "Let's make a bar chart", I had an idea: I will pick up where he left off and add something new to the simple bar chart we have at the end of the last part of that tutorial:

@atestu
atestu / top-players-2013.py
Created January 25, 2014 17:32
Using nfldb to get the top players in the NFL in 2013
import nfldb
import json
from pprint import pprint
db = nfldb.connect()
q = nfldb.Query(db)
q.game(season_year=2013).player()
print json.dumps(map(lambda pp: {
@atestu
atestu / README.markdown
Last active December 29, 2015 23:09
Artsy Quilt makes image quilts out of tag and gene pages on Artsy. It is based on the work of Edward Tufte and inspired by the ImageQuilt extension created by Tufte and Adam Schwartz.
@atestu
atestu / picks.md
Last active December 22, 2015 09:19
NFL 2013 Week 1 Predictions

The result is pts won by the team / total pts. Over 50% means the game is won, and you get a sense of the intensity of the win that way.

Tampa Bay Buccaneers49%90%FALSE80%
TeamResultOdds of winningVerdictConfidence
Baltimore Ravens36%49%TRUE64%
Cincinnati Bengals47%65%FALSE81%
New England Patriots52%92%TRUE83%
Miami Dolphins70%36%FALSE73%
Atlanta Falcons43%57%FALSE87%