Skip to content

Instantly share code, notes, and snippets.

@batpigandme
batpigandme / rvm error make.log
Created February 19, 2013 16:18
rvm error make.log
[2013-02-19 09:25:50] make
CC = clang
LD = ld
LDSHARED = clang -dynamic -bundle
CFLAGS = -O3 -ggdb -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Werror=pointer-arith -Werror=write-strings -Werror=declaration-after-statement -Werror=shorten-64-to-32 -Werror=implicit-function-declaration -pipe
XCFLAGS = -include ruby/config.h -include ruby/missing.h -fvisibility=hidden -DRUBY_EXPORT
CPPFLAGS = -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -I/Users/maraaverick/.rvm/usr/include -I. -I.ext/include/x86_64-darwin12.2.0 -I./include -I.
DLDFLAGS = -Wl,-undefined,dynamic_lookup -Wl,-multiply_defined,suppress -Wl,-flat_namespace
SOLIBS =
compiling regparse.c
@batpigandme
batpigandme / gcc version
Created February 20, 2013 20:19
gcc version detection
gcc --version
gcc (GCC) 4.8.0 20130113 (experimental)
Copyright (C) 2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
@batpigandme
batpigandme / Tumblr Text posts for SE
Last active December 18, 2015 13:49
Tumblr text posts
api.tumblr.com/v2/blog/{base-hostname}/posts/text?api_key={key}&[optional-params=]
// Response format
"response": {
"blog": { ... },
"posts": [
{
"blog_name": "citriccomics",
"id": 3507845453,
"post_url": "http:\/\/citriccomics.tumblr.com\/post\/3507845453",
@batpigandme
batpigandme / stattle_nba_point_leads_sm_multiples.R
Last active January 29, 2016 15:23
Different ways of visualizing team point leads and outcomes using small multiples.
## visualize team point leads and outcomes with small multiples
## install and load ggplot2
install.packages("ggplot2")
library(ggplot2)
## make separate point plots for each team
ggplot(teamgame_point_leads, aes(x=final_point_diff, y=points_biggest_lead)) + geom_point() +
facet_wrap(~team_slug)
@batpigandme
batpigandme / opponent_team_lead_table_plus_summary.R
Last active January 29, 2016 17:12
Match opponent leads to team game logs and select variables for new, focused data table, as well as a summary table for each team.
## set keys for the data table on game_slug and opponent_slug
team_game_logs <- setkey(team_game_logs, game_slug, opponent_slug)
## get opponent leads by matching on both key columns
team_game_logs$opp_biggest_lead <- team_game_logs[. (team_game_logs$game_slug, team_game_logs$opponent_slug)]$points_biggest_lead
## set keys for the data table on game_slug and opponent_slug
team_game_logs <- setkey(team_game_logs, game_slug, opponent_slug)
## get opponent leads by matching on both key columns
@batpigandme
batpigandme / steph_curry_3ptpct_densityplot.R
Created February 24, 2016 18:37
Make a density plot of Steph Curry's three point percentages so far this season by game.
d3pct <- density(steph_gls$three_pointers_pct)
plot(d3pct)
@batpigandme
batpigandme / curry_three_pointers_base_ggplot.R
Last active February 25, 2016 15:14
EDA with density plot and histograms of nba-stephen-curry three point shooting, base R, and with ggplot2 and ggthemes
## steph curry's three-point shooting data from
## stattleship api
## density plot of three-pt pctg
d <- density(steph_gls$three_pointers_pct)
plot(d, type="n", main="three point percentage")
polygon(d, col="red", border="gray")
## histograms
hist(steph_gls$three_pointers_attempted)
@batpigandme
batpigandme / summary_threes_curry_gls.txt
Last active February 25, 2016 16:33
nba-stephen-curry summary of three point stats
│ three_pointers_attempted │ three_pointers_made │ three_pointers_pct │
├──────────────────────────┼─────────────────────┼────────────────────┤
│ Min. : 4.00 │ Min. : 1.000 │ Min. :0.1110 │
│ 1st Qu.: 9.00 │ 1st Qu.: 3.000 │ 1st Qu.:0.3407 │
│ Median :11.00 │ Median : 5.000 │ Median :0.4550 │
│ Mean :10.81 │ Mean : 4.926 │ Mean :0.4401 │
│ 3rd Qu.:13.00 │ 3rd Qu.: 7.000 │ 3rd Qu.:0.5000 │
│ Max. :16.00 │ Max. :11.000 │ Max. :0.7330 │
@batpigandme
batpigandme / deandre_jordan_game_logs.R
Last active August 29, 2016 12:58
Gets all game logs for DeAndre Jordan this season from the Stattleship API.
## install and load the stattleshipR package
devtools::install_github("stattleship/stattleship-r")
library(stattleshipR)
## get your API token stattleship.com
## set your API token
set_token('YOUR_ACCESS_TOKEN')
## Set params according to
## developers.stattleship.com
@batpigandme
batpigandme / nba_game_log_retrieval.R
Last active August 29, 2016 12:58
Gets all of the game logs for each player for each game in the NBA from the Stattleship API.
## install and load the stattleshipR package
devtools::install_github("stattleship/stattleship-r")
library(stattleshipR)
## get your API token stattleship.com
## set your API token
set_token('YOUR_ACCESS_TOKEN')
## set params according to
## developers.stattleship.com