Skip to content

Instantly share code, notes, and snippets.

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

mar10 obar1

🏠
Working from home
View GitHub Profile
@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...
___.-''''-.
/___ @ |
',,,,. | _.'''''''._
' | / \
| \ _.-' \
| '.-' '-.
| ',
| '',
@obar1
obar1 / old_branch_delete
Created February 15, 2023 10:48
old_branch_delete Just add this alias to your .bashrc/.bash_profile, the two commands made into one and I updated the second to work on all shells:
alias old_branch_delete='git fetch -p && git branch -vv | awk "/: gone]/{print \$1}" | xargs git branch -D'
@obar1
obar1 / Git-alias.md
Last active February 10, 2023 11:33 — forked from mikaelhadler/Git-alias.md
Add alias bash and git alias

For your alias to be insert in commands bash, you need to include that in .bashrc, so take this example and to be happy:

echo alias g=\'git\' >> .bashrc

If you have a success with this command, you can now call git with 'g' command.

Now, if you like alias git, you can create your personal alias file, take this example and edit your file ~ / .gitconfig: