This file contains hidden or 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
def mock_api_stream(): | |
MESSAGE_CONTENTS = [ | |
"mess", | |
"age", | |
" start", | |
":", | |
" This", | |
" is", | |
" a", | |
" nice ", |
This file contains hidden or 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
"""Example of a simple nurse scheduling problem.""" | |
from ortools.sat.python import cp_model | |
class Nurse: | |
def __init__(self, name, start): | |
self.name = name | |
self.start = start |
This file contains hidden or 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
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 |
This file contains hidden or 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
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' |
This file contains hidden or 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
Excerpt From | |
Deployment from Scratch | |
Josef Strzibny | |
This material may be protected by copyright. |
This file contains hidden or 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
import json | |
import time | |
import whisper | |
MODEL_TYPE = "large" | |
model = whisper.load_model(MODEL_TYPE) | |
start = time.time() | |
file_name = "video" |
This file contains hidden or 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
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, | |
}); |
This file contains hidden or 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
# 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 |
This file contains hidden or 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
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 |
NewerOlder