Skip to content

Instantly share code, notes, and snippets.

View obar1's full-sized avatar
:shipit:
looking for a job

mar10 obar1

:shipit:
looking for a job
View GitHub Profile
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:

@obar1
obar1 / multiple github account.md
Created November 4, 2022 18:37
multiple github account
@obar1
obar1 / js_drop_protocol.js
Created September 27, 2022 08:34
trick to drop http:// or https:// from address copied in clipbaord
javascript:(function(){
function executeCopy(th, turl) {
var input = document.createElement('textarea');
document.body.appendChild(input);
input.value = turl.replace(th.concat('//'),'');
input.select();
document.execCommand('Copy');
input.remove(); }
@obar1
obar1 / youtube-dl-parallel
Created May 25, 2022 13:00
youtube-dl in parallel
```
PLAYLIST_URL=https://www.youtube.com/channel/UCLg31aQBp1yRLtoe49jWVEA
youtube-dl --get-id "$PLAYLIST_URL" \
| xargs -I '{}' -P 10 youtube-dl -f "bestvideo[height>=720]+bestaudio/best" --format=mp4 -ciw -o "%(upload_date)s-%(title)s.%(ext)s" 'https://youtube.com/watch?v={}'
```
#!/usr/bin/env bash
# This script clones all repos in a GitHub org
# It requires the GH CLI: https://cli.github.com
set -euo pipefail
USAGE="Usage: gh-clone-org <user|org>"
[[ $# -eq 0 ]] && echo >&2 "missing arguments: ${USAGE}" && exit 1
#!/bin/bash
# tar folder
set -u
set -x
prefix="kb_"
ts=`date +%s`
to_bkp='kb'