Skip to content

Instantly share code, notes, and snippets.

function get_git_repo_url() {
# Get the SSH URL from the current Git configuration
local ssh_url=$(git config remote.origin.url)
# Check if ssh_url is empty
if [ -z "$ssh_url" ]; then
echo "Not a git repository or no origin set"
return 1
fi
alias did='vim ~/did.txt'
alias todo='vim ~/todo.txt'
alias zrc='vim ~/.oh-my-zsh/custom/myaliases.zsh'
alias zs='exec zsh'
alias gotodidlist='cd ~/projamming/todidlistdjango/todidlist'
alias ls='ls -1p'
alias rm='rm -i'
alias ga='git add'
@theptrk
theptrk / note.txt
Last active December 27, 2023 05:39
Excerpt From
Deployment from Scratch
Josef Strzibny
This material may be protected by copyright.
import json
import time
import whisper
MODEL_TYPE = "large"
model = whisper.load_model(MODEL_TYPE)
start = time.time()
file_name = "video"
@theptrk
theptrk / react-typescript-form-onsubmit.tsx
Created June 8, 2023 18:48
react-typescript-form-onsubmit
const TagSearchPage: NextPage<{ query: string }> = ({ query }) => {
const router = useRouter();
const [input, setInput] = useState(query);
const newPath = `/search/${input}`;
const title = `Search: ${query}`;
const { data, isLoading } = api.search.getAll.useQuery({
query,
});
print("""
Find the supported major python version on cookiecutter-django
https://github.com/cookiecutter/cookiecutter-django
Find the supported minor python version on heroku
https://devcenter.heroku.com/articles/python-support#supported-runtimes
""")
version = input("What is the latest supported version? ")
print(f"$ pyenv install {version}; -- to install ")
# https://developer.todoist.com/sync/v9#summary-of-contents
def request_todoist_activity(api_key):
url = "https://api.todoist.com/sync/v9/activity/get"
headers = {
"Authorization": f"Bearer { api_key }",
}
limit: int = 100
# page represents week BUT its limited by the max limit of 100
# 1 - 1 WEEK
from django.core.exceptions import PermissionDenied
from django.shortcuts import get_object_or_404
from django.shortcuts import render
from django.shortcuts import redirect
from django.contrib.auth.decorators import login_required
@theptrk
theptrk / the-spelled-out-intro-to-neural-networks-part2.ipynb
Created October 20, 2022 15:06
The spelled-out intro to neural networks - Part2.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@theptrk
theptrk / the-spelled-out-intro-to-neural-networks-part-1.ipynb
Created October 20, 2022 15:05
The spelled-out intro to neural networks - Part 1.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.