Skip to content

Instantly share code, notes, and snippets.

@DaniruKun
DaniruKun / yt-clip.sh
Created May 17, 2021 21:08
Download YT VOD in timestamp interval
youtube-dl -f "(bestvideo+bestaudio/best)[protocol!*=dash]" --external-downloader ffmpeg --external-downloader-args "-ss 00:00:00 -to 00:00:00" "youtube link"
# taken from http://www.piware.de/2011/01/creating-an-https-server-in-python/
# generate server.xml with the following command:
# openssl req -new -x509 -keyout server.pem -out server.pem -days 365 -nodes
# run as follows:
# python simple-https-server.py
# then in your browser, visit:
# https://localhost:4443
import BaseHTTPServer, SimpleHTTPServer
import ssl
@luismts
luismts / GitCommitBestPractices.md
Last active May 20, 2024 17:02
Git Tips and Git Commit Best Practices

Git Commit Best Practices

Basic Rules

Commit Related Changes

A commit should be a wrapper for related changes. For example, fixing two different bugs should produce two separate commits. Small commits make it easier for other developers to understand the changes and roll them back if something went wrong. With tools like the staging area and the ability to stage only parts of a file, Git makes it easy to create very granular commits.

Commit Often

Committing often keeps your commits small and, again, helps you commit only related changes. Moreover, it allows you to share your code more frequently with others. That way it‘s easier for everyone to integrate changes regularly and avoid having merge conflicts. Having large commits and sharing them infrequently, in contrast, makes it hard to solve conflicts.

#!/bin/bash
#SBATCH --account=3214046
#SBATCH --partition=dsba
#SBATCH --gpus=1
#SBATCH --mem=10G
#SBATCH --job-name="check"
#SBATCH --time=03:00:00
#SBATCH --output=/home/3214046/my_dir/output/%x.out
#SBATCH --error=/home/3214046/my_dir/error/%x.err
1.Run git clone <my-cool-project>
2.Run composer install
3.Run cp .env.example .env
4.Run php artisan key:generate
5.Run php artisan migrate
6.Run php artisan serve
7.Go to link localhost:8000
@pansapiens
pansapiens / 0README.md
Last active May 20, 2024 16:56
RStudio Server in Singularity (via rocker), M3 HPC flavour
@yufengwng
yufengwng / arch_cheatsheet.txt
Last active May 20, 2024 16:54
Arch Linux Commands Cheatsheet
pacman
======
view logs: /var/log/pacman.log
update system
# pacman -Syu
list installed packages
# pacman -Q
@hchocobar
hchocobar / py_pep8.md
Last active May 20, 2024 16:53
Python - PEP 8: Style Guide for Python Code

PEPs - Python Enhancement Proposals

Propuesta de mejora de Python, del inglés Python Enhancement Proposal.

Los PEPs tienen como propósito ser los mecanismos primarios para proponer nuevas y mayores capacidades, para recoger la opinión de la comunidad sobre un tema, y para documentar las decisiones de diseño que se han hecho en Python.

Si deseas ver el listado completo de los PEPs puedes econtrarlo en el listado oficial de PEPs

Si estás dando tus primeos pasos en Python, hay algunas que debes conocer, si o sí, y aplicarlas: ellas son la PEP8 y la PEP20.

@gopsmith
gopsmith / disable.sh
Last active May 20, 2024 16:51
Disable bunch of #$!@ in High Sierra
#!/bin/bash
# NOTE: This script must be run from Terminal within RECOVERY MODE. This version is for macOS High Sierra.
# There is no need to disable SIP (via csrutil), because recovery mode is not constrained by SIP.
# WARNING: It might enable things that you may not like. Please double check the services in the TODISABLE vars.
#
# For OSes newer than High Sierra, see comments in the original gist author's Catalina version, at
# https://gist.github.com/pwnsdx/1217727ca57de2dd2a372afdd7a0fc21
# (see the "Note about Big Sur" at the top, and there are comments about Monterey further down).
#
from pathlib import Path
import environ # type: ignore
# Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR = Path(__file__).resolve().parent.parent
env = environ.Env(
# set casting, default value
DEBUG=(bool, False)
)