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 / 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
@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_team_game_log_retrieval.R
Last active August 29, 2016 13:00
Get all of the game logs for the NBA teams without pre-loading team information.
#########################################################################
## Get NBA Team Game Logs From the Stattleship API
#########################################################################
## install and load the stattleshipR package
devtools::install_github("stattleship/stattleship-r")
library(stattleshipR)
## set API token
set_token('YOUR_ACCESS_TOKEN')
@batpigandme
batpigandme / nba_games_retrieval.R
Last active August 29, 2016 13:00
Get NBA games 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 API token
set_token('YOUR_ACCESS_TOKEN')
## load NBA teams data frame
load("nba_teams.Rdata")
@batpigandme
batpigandme / nba_team_retrieval.R
Last active August 29, 2016 12:59
Retrieve NBA teams using Stattleship API
## install and load the stattleshipR package
devtools::install_github("stattleship/stattleship-r")
library(stattleshipR)
## get API token at playbook.stattleship.com
## set API token
set_token('YOUR_ACCESS_TOKEN')
## set up envt
options(stringsAsFactors=FALSE)
@batpigandme
batpigandme / team_game_logs_for_lead_post.R
Last active August 29, 2016 13:01
Get and load team game logs from Stattleship API. Assumes you've retrieved teams, if not, see: https://gist.github.com/batpigandme/d06f279369546dbfe462
## load the stattleshipR and dplyr packages
library(stattleshipR)
library(dplyr)
## set params for team_game_logs
sport <- "basketball"
league <- "nba"
ep <- "team_game_logs"
## leave q_body empty to get all
@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