Skip to content

Instantly share code, notes, and snippets.

View khuyentran1401's full-sized avatar
🏠
Working from home

Khuyen Tran khuyentran1401

🏠
Working from home
View GitHub Profile
import json
def save_data(data: dict, config: DictConfig):
with open(config.data.raw, "w") as file:
json.dump(data, file)
{
"id": 507959643,
"node_id": "R_kgDOHkbZWw",
"name": "prize",
"full_name": "inverse-scaling/prize",
"private": false,
"owner": {
"login": "inverse-scaling",
"id": 107094088,
"node_id": "U_kgDOBmIgSA",
def get_specific_info_of_repos(auth: dict, repo_urls: list):
data = []
for url in repo_urls:
response = requests.get(
url,
auth=(auth["username"], auth["token"]),
)
data.append(response.json())
return data
from pydash import py_
def get_starred_repo_urls(data: list):
return py_(data).filter({"type": "WatchEvent"}).map("repo.url").value()
from dotenv import load_dotenv
def get_authentication():
load_dotenv()
username = os.getenv("username")
token = os.getenv("token")
return {"username": username, "token": token}
import requests
def get_general_info_of_repos(auth: dict):
response = requests.get(
f"https://api.github.com/users/{auth['username']}/received_events/public?per_page=100",
auth=(auth["username"], auth["token"]),
)
data = response.json()
return data
// Future versions of Hyper may add additional config options,
// which will not automatically be merged into this file.
// See https://hyper.is#cfg for all currently supported options.
module.exports = {
config: {
// choose either `'stable'` for receiving highly polished,
// or `'canary'` for less polished but more frequent updates
updateChannel: 'stable',
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH="/Users/khuyen/.oh-my-zsh"
# Path to VSCOde
export PATH="$PATH:/Applications/Visual Studio Code.app/Contents/Resources/app/bin"
export PATH="$PATH:/Library/Python/3.9/lib/python/site-packages"
from pandera import check_input
@check_input(schema)
def get_total_price(fruits: pd.DataFrame):
return fruits.price.sum()
get_total_price(fruits)