Skip to content

Instantly share code, notes, and snippets.

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
server {
listen 80;
listen [::]:80;
server_name _;
root /home/deploy/myapp/current/public;
passenger_enabled on;
passenger_spawn_method direct;
@erinata
erinata / github_request_with_login.py
Last active October 19, 2022 20:55
Github API examples
import requests
import json
github_session = requests.Session()
github_session.auth = ( "your_github_id", "your_personal_access_token")
response_text = github_session.get("https://api.github.com/users/erinata").text
json_text = json.loads(response_text)
@erinata
erinata / testing.r
Last active October 17, 2022 23:56
pivot longer example
library(tidyr)
library(dplyr)
library(readr)
dataset <- tribble(
~id, ~x1990, ~x1991, ~x1992, ~var1990, ~var1991, ~var1992,
1, 20, 23, 27, 120, 24, 28,
2, 30, 33, 37, 130, 34, 38,
3, 40, 43, 47, 140, 44, 48,
4, 50, 53, 57, 150, 54, 58,
@erinata
erinata / test.html
Last active October 14, 2022 00:57
html template
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>testing</title>
</head>
<body>
<div>test</div>
<span>test
@erinata
erinata / small_program.py
Last active November 6, 2020 04:38
parsing eample
one_file_name = "html_files/coinmarketcap20200929132624.html"
print(one_file_name)
f = open(one_file_name, "r")
soup = BeautifulSoup(f.read(), "html.parser")
f.close()
currencies_table = soup.find("tbody")
currency_rows = currencies_table.find_all("tr")
for r in currency_rows:
CFLAGS="-I$(brew --prefix readline)/include -I$(brew --prefix openssl)/include -I$(xcrun --show-sdk-path)/usr/include" \
LDFLAGS="-L$(brew --prefix readline)/lib -L$(brew --prefix openssl)/lib" \
PYTHON_CONFIGURE_OPTS="--enable-framework --enable-ipv6 --enable-unicode=ucs2 --with-threads" \
pyenv install -v 3.7.3
iam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo