Skip to content

Instantly share code, notes, and snippets.

View obar1's full-sized avatar
:octocat:

obar1 obar1

:octocat:
View GitHub Profile
@obar1
obar1 / venv_cd.sh
Created April 11, 2024 04:13
venv auto cd handling for 0to100 folder
function venv_cd() {
# set -x
if [[ $PWD == */0to100* ]]; then
echo "0to100 folder..."
if [[ -d .venv ]]; then
if [[ "$VIRTUAL_ENV" == "$PWD/.venv" ]]; then
echo "using $VIRTUAL_ENV"
else
deactivate || true
source .venv/bin/activate
@obar1
obar1 / update_0to100s.sh
Last active April 10, 2024 19:51
update 0 to 100 repos
#!/bin/bash
set -x
function get_latest_main {
cd 0to100.git
pwd
git fetch
git checkout main
git pull
cd -
@obar1
obar1 / get oreilly cookies.md
Created December 15, 2023 04:19
get oreilly cookies

https://learning.oreilly.com/profile/

console.log(JSON.stringify(document.cookie.split(';').map(c => c.split('=')).map(i => [i[0].trim(), i[1].trim()]).reduce((r, i) => {r[i[0]] = i[1]; return r;}, {})))
@obar1
obar1 / obar1.uses.ps1.sh
Last active October 25, 2023 03:39
my ps1
# - bash history id
# - current pwd but only last folder
# - colored git branch
# v0.1
PS1='\! ${PWD#"${PWD%/*/*}/"}\n\e[1;34m\W$(__git_ps1 " (%s)")] \e[m'
@obar1
obar1 / read_from_file_and_do_shit.sqh
Created July 7, 2023 10:54
read fro file and do shit in bash
while read line; do
printf "%s %s\n" "git mv $line https§§§__$line"
done <"$1"
@obar1
obar1 / how_to_absorb_0to100.md
Last active June 28, 2023 09:21
how to absorb 0to100
@obar1
obar1 / poweshell_gwip
Created June 7, 2023 08:52
poweshell gwip
PS C:\Users\mario\Dropbox\0to100gcloud> git add . ; git commit -m "wip" ; git push
https://help.dropbox.com/sync/ignored-files
Set-Content -Path 'C:\Users\yourname\Dropbox(Personal)\YourFileName.pdf' -Stream com.dropbox.ignored -Value 1
or better
PS C:\Users\mario\Dropbox\gcloud_0to100> Set-Content ./.git:com.dropbox.ignored -value 1
> https://www.dropboxforum.com/t5/Apps-and-Installations/Ignoring-a-directory-does-not-work/td-p/679164
@obar1
obar1 / small_md.py
Created March 13, 2023 16:36
small md editor
import string
def apply_formatter(mk_format: str):
formatted_string = ""
if mk_format in ("header", "plain", "bold", "italic", "inline-code"):
if mk_format == "header":
while True:
header_lvl = int(input("Level:"))
if 1 <= header_lvl <= 6:
@obar1
obar1 / zoo.py
Created March 13, 2023 12:27
asiic art :)
camel = r"""
Switching on the camera in the camel habitat...
___.-''''-.
/___ @ |
',,,,. | _.'''''''._
' | / \
| \ _.-' \
| '.-' '-.
| ',
| '',