Skip to content

Instantly share code, notes, and snippets.

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

obar1 obar1

🏠
Working from home
View GitHub Profile
@obar1
obar1 / 0_reuse_code.js
Created December 8, 2016 12:52
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@obar1
obar1 / youtube-ls-playlist.sh
Created September 10, 2017 18:31 — forked from zmwangx/youtube-ls-playlist.sh
List video URIs in a YouTube playlist.
#!/usr/bin/env bash
# Takes a YouTube URI to a playlist (fairly liberal, it's fine as long
# as the playlist id can be extracted), and prints a list of URIs in a
# YouTube playlist.
#
# Requires youtube-dl 2014.10.24, tested on youtube-dl
# 2014.11.02.1. Feature subject to change.
youtube-dl -j --flat-playlist "$1" | jq -r '.id' | sed 's_^_https://youtube.com/v/_'
@obar1
obar1 / udemy-courses-download-using-cookies.md
Created November 15, 2017 15:57 — forked from barbietunnie/udemy-courses-download-using-cookies.md
Downloading Udemy videos with youtube-dl

Download Udemy course videos using youtube-dl

$ youtube-dl --list-extractors | grep udemy

Steps

  1. Get link to the course to download. e.g. https://www.udemy.com/course-name/
  2. Login into udemy website, save the cookie from chrome using Chrome (Cookie.txt)[1] export extension. Save it to file udemy-cookies.txt
  3. Get the link of the video that you want to download. usually in format. Use the command provided below where you have to replace the {course_link} and {path_to_cookies_file} with respective paths.

# $ youtube-dl {course_link} --cookies {path_to_cookies_file}

#!/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
@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: