Skip to content

Instantly share code, notes, and snippets.

@DustinAlandzes
DustinAlandzes / notebook.ipynb
Last active March 21, 2021 23:07
Copy of slippi-graph.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
f00@f00s-MacBook-Pro build % cmake ..
CMake Warning (dev) at CMakeLists.txt:5 (project):
Policy CMP0048 is not set: project() command manages VERSION variables.
Run "cmake --help-policy CMP0048" for policy details. Use the cmake_policy
command to set the policy and suppress this warning.
The following variable(s) would be set to empty:
CMAKE_PROJECT_VERSION
CMAKE_PROJECT_VERSION_MAJOR
@DustinAlandzes
DustinAlandzes / .bashrc
Last active June 5, 2022 00:24
My .bashrc file
# welcome to my .bashrc!
if [[ $(uname -s) == "darwin" ]]; then
# brew on osx
eval "$(/opt/homebrew/bin/brew shellenv)"
fi
# empty commit
alias empty-commit='git commit --allow-empty -m "this is an empty commit"'
labs/management/commands/labs_quest_update_cdc.py:32: error: Expression type contains "Any" (has type "ImmutableList[Any]")
labs/management/commands/labs_quest_update_cdc.py:33: error: "str" has no attribute "name"
labs/management/commands/labs_quest_update_cdc.py:33: error: Expression has type "Any"
labs/management/commands/labs_quest_update_cdc.py:53: error: Expression has type "Any"
labs/management/commands/labs_quest_update_cdc.py:53: error: Expression type contains "Any" (has type "Iterator[Any]")
labs/management/commands/labs_quest_update_cdc.py:54: error: Expression has type "Any"
labs/management/commands/labs_quest_update_cdc.py:54: error: Expression type contains "Any" (has type "Tuple[Any, Any]")
labs/management/commands/labs_quest_update_cdc.py:58: error: Expression has type "Any"
labs/management/commands/labs_quest_update_cdc.py:58: error: Expression type contains "Any" (has type "Callable[[Any], Any]")
labs/management/commands/labs_quest_update_cdc.py:59: error: Expression has type "Any"
@DustinAlandzes
DustinAlandzes / create_issues.py
Last active January 12, 2020 15:35
Script to pull assignments that need to be graded from bootcamp spot (now excluding Milestone and Juan)
import random
from github import Github
from main import BootcampSpot
ACCESS_TOKEN = os.environ.get("ACCESS_TOKEN")
g = Github(ACCESS_TOKEN)
bootcamp_spot = BootcampSpot()
@DustinAlandzes
DustinAlandzes / gist:2fe249252c017b15d333bc01a44d2cb8
Created December 13, 2019 18:02
Used this script and https://writeapp.net/notesexporter/ to export text from notes.app
import os
from markdownify import markdownify as md
import sys
print(sys.getdefaultencoding())
NOTES_PATH = "/Users/f00/Documents/notes-backup"
notes = os.listdir(NOTES_PATH)
for note in notes:
@DustinAlandzes
DustinAlandzes / zh-vocabulary-overview.json
Created November 23, 2019 21:58
Duolingo Mandarin Chinese vocabulary list, from: https://www.duolingo.com/vocabulary/overview
{"language_string":"Chinese","learning_language":"zs","from_language":"en","language_information":{"pronoun_mapping":[],"tenses":{}},"vocab_overview":[{"strength_bars":4,"infinitive":null,"normalized_string":"Xue Sheng ","pos":null,"last_practiced_ms":1574328549000,"skill":"Occupation","related_lexemes":[],"last_practiced":"2019-11-21T09:29:09Z","strength":0.999981,"skill_url_title":"Occupation","gender":null,"id":"b85eb4fe8c2f94c62ebbfdc9b31fbda7","lexeme_id":"b85eb4fe8c2f94c62ebbfdc9b31fbda7","word_string":"\u5b66\u751f"},{"strength_bars":4,"infinitive":null,"normalized_string":"Yi Yu ","pos":null,"last_practiced_ms":1574328549000,"skill":"Phrases 2","related_lexemes":[],"last_practiced":"2019-11-21T09:29:09Z","strength":0.999981,"skill_url_title":"Phrases-2","gender":null,"id":"3634d523ea51e519121f3abc7d729405","lexeme_id":"3634d523ea51e519121f3abc7d729405","word_string":"\u6c49\u8bed"},{"strength_bars":4,"infinitive":null,"normalized_string":"Lao Shi ","pos":null,"last_practiced_ms":1574328549000,"skill":
@DustinAlandzes
DustinAlandzes / bigquery.Rmd
Last active October 29, 2019 03:21
How to load bigquery data with r, you need to create a gcp project (here, mine is called "public-bigquery") and copy the data over before running this: https://console.cloud.google.com/bigquery
---
title: "R Notebook"
output: html_notebook
---
# install bigrquery if needed
install.packages("httpuv")
install.packages("gargle")
install.packages("bigrquery")
library(httpuv)
## simulate data for ab test
import numpy as np
np.random.seed(42)
from scipy.stats import beta # beta distribution
# 1000 trials in both A and B groups
group_size = 1000
A_group, B_group = np.random.rand(2, group_size)
@DustinAlandzes
DustinAlandzes / gist:2832d75c36b0963781035239f98f1c3e
Created October 22, 2019 03:14
Calculating sample size with statsmodels in python (3% base conversion, 5% relative MDE = 3.15%)
from statmodels.stats.power import tt_ind_solve_power
from statsmodels.stats.proportion import proportion_effectsize
es = proportion_effectsize(0.03, 0.0315)
n = tt_ind_solve_power(effect_size=es, ratio=1, power=0.8, alpha=0.05)
# from https://speakerdeck.com/nneu/b-testing-a-bayesian-approach?slide=36