View open_pr_by_commit.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Get PR number for a specific commit | |
local pr_number=$(git log --reverse --ancestry-path <commit_id>..master --grep="Merge pull request" --oneline | head -n 1 | awk '{print $5}' | sed -E 's/#//g') | |
# Open PR in the browser | |
open "https://github.tumblr.net/TumblrMobile/android2/pull/$pr_number" |
View getMergedManifest.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cat <module_name>/build/intermediates/merged_manifest/celrayDebug/out/AndroidManifest.xml | pbcopy |
View aws_dynamo_101.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# List all the tables using a profile | |
aws dynamodb list-tables --profile <profile_name> | jq | |
# Get all item in a table using a profile (expensive) | |
aws dynamodb scan --table-name <table_name> --profile <profile_name> | jq | |
# Get an specific item based on id using a profile | |
aws dynamodb get-item --key '{"id":{"S":"009871"}}' --table-name <table_name> --profile <profile_name> | jq | |
# Create an item using a profile |
View residual.R
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Find the largest residual of 2 digits number that can be divided by the sum of itself | |
# maxres(ab/(a+b)) | |
library(tidyr) | |
count <- 0 | |
max_index <- 0 | |
for( i in 10:99) { | |
digits <- as.integer(substring(i, seq(nchar(i)), seq(nchar(i)))) | |
aplusb <- digits[1] + digits[2] |
View variation.R
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Get all numbers 3 digits, divisible by 3 that follow this formula | |
# a + 3b + c where a != 0 | |
library(tidyr) | |
count <- 0 | |
n <- c() | |
for( i in 100:999) { | |
digits <- as.integer(substring(i, seq(nchar(i)), seq(nchar(i)))) | |
formula <- (digits[1] + 3*digits[2] + digits[3]) |
View ptf_data_extraction.R
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(readr) | |
library(skimr) | |
library(dplyr) | |
library(stringr) | |
data <- readr::read_csv('data.csv') | |
skimr::skim(data) | |
data_cleaned <- data %>% filter(!stringr::str_detect(Page, "@powertofly\\.com")) %>% | |
mutate(Registrations = |
View lambda_selection_glmnet.R
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(glmnet) | |
x_var <- data.matrix(mtcars[, c("hp", "wt", "drat")]) | |
y_var <- mtcars[, "mpg"] | |
fit_lambda_specified <- cv.glmnet(x_var, y_var, alpha = 0, lambda = 10^seq(5, -5, by = -.1)) | |
fit_lambda_automatic <- cv.glmnet(x_var, y_var, alpha = 0) | |
plot(fit_lambda_specified, xvar="lambda") | |
plot(fit_lambda_automatic, xvar="lambda") |
View spacyr_bug.R
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
corpus <- readr::read_csv("corpus.csv") | |
# Work with | |
#t <- corpus$text[1:100] | |
t <- corpus$text[124] | |
spacyr::spacy_tokenize(t) |
View corpus.csv
We can't make this file beautiful and searchable because it's too large.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
text,label | |
Stuning even for the non-gamer: This sound track was beautiful! It paints the senery in your mind so well I would recomend it even to people who hate video game music! I have played the game Chrono Cross but out of all of the games I have ever played it has the best music! It backs away from crude keyboarding and takes a fresher step with grate guitars and soulful orchestras. It would impress anyone who cares to listen! ^_^,__label__2 | |
" The best soundtrack ever to anything.: I'm reading a lot of reviews saying that this is the best 'game soundtrack' and I figured that I'd write a review to disagree a bit. This in my opinino is Yasunori Mitsuda's ultimate masterpiece. The music is timeless and I'm been listening to it for years now and its beauty simply refuses to fade.The price tag on this is pretty staggering I must say, but if you are going to buy any cd for this much money, this is the only one that I feel would be worth every penny.",__label__2 |
View gradient_background_ggplot2.R
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
g <- rasterGrob(greens, width = unit(1, "npc"), height = unit(1, "npc"), interpolate = TRUE) | |
test <- ggplot(mtcars, aes(x = mtcars$hp, y = mtcars$mpg)) + | |
theme(plot.background = element_blank(), | |
panel.background = element_blank()) + | |
annotation_custom( | |
grob = g, xmin = -Inf, xmax = Inf, ymin = -Inf, ymax = Inf | |
) + geom_point() | |
plot_grid(test, labels = c('A')) |
NewerOlder