Skip to content

Instantly share code, notes, and snippets.

@mehranhadidi
mehranhadidi / !NOTE.md
Created Aug 15, 2017 — forked from ivanvermeyen/!NOTE.md
Setup a Laravel Storage driver with Google Drive API
View !NOTE.md
@mdegat01
mdegat01 / update_notifications.yaml
Last active Aug 8, 2022
Update Notifications Automation Blueprint
View update_notifications.yaml
blueprint:
name: Update notifications
description: Send notifications for new updates and install or skip on action
homeassistant:
min_version: '2022.4.0'
domain: automation
input:
update_entities:
name: Update entities
description: >-
@codigoconjuan
codigoconjuan / db.sql
Last active Aug 8, 2022
Introducción a Bases de Datos
View db.sql
INSERT INTO reservaciones (nombre, apellido, hora, fecha, servicios) VALUES
('Juan', 'De la torre', '10:30:00', '2021-06-28', 'Corte de Cabello Adulto, Corte de Barba' ),
('Antonio', 'Hernandez', '14:00:00', '2021-07-30', 'Corte de Cabello Niño'),
('Pedro', 'Juarez', '20:00:00', '2021-06-25', 'Corte de Cabello Adulto'),
('Mireya', 'Perez', '19:00:00', '2021-06-25', 'Peinado Mujer'),
('Jose', 'Castillo', '14:00:00', '2021-07-30', 'Peinado Hombre'),
('Maria', 'Diaz', '14:30:00', '2021-06-25', 'Tinte'),
('Clara', 'Duran', '10:00:00', '2021-07-01', 'Uñas, Tinte, Corte de Cabello Mujer'),
('Miriam', 'Ibañez', '09:00:00', '2021-07-01', 'Tinte'),
@davydany
davydany / Bash Colors
Last active Aug 8, 2022
log4bash :-D - Just putting colors for nice clean logs in bash
View Bash Colors
BLACK="\033[0;30m"
DARK_GRAY="\033[1;30m"
LIGHT_GRAY="\033[0;37m"
WHITE="\033[1;37m"
BLUE="\033[0;34m"
LIGHT_BLUE="\033[1;34m"
GREEN="\033[0;32m"
LIGHT_GREEN="\033[1;32m"
@grenade
grenade / 01-generate-ed25519-ssh-key.sh
Last active Aug 8, 2022
generate ed25519 ssh and gpg/pgp keys and set file permissions for ssh keys and config
View 01-generate-ed25519-ssh-key.sh
#!/bin/bash
# generate new personal ed25519 ssh key
ssh-keygen -o -a 100 -t ed25519 -f ~/.ssh/id_ed25519 -C "rob thijssen <rthijssen@gmail.com>"
# generate new host cert authority (host_ca) ed25519 ssh key
# used for signing host keys and creating host certs
ssh-keygen -t ed25519 -f manta_host_ca -C manta.network
eval "$(ssh-agent -s)"
@mbentley
mbentley / debian_8.sh
Last active Aug 8, 2022
Enable ttyS0 (Ubuntu 14.04 and Debian 8 (jessie)
View debian_8.sh
### debian 8 (jessie)
mkdir /etc/systemd/system/serial-getty@ttyS0.service.d &&\
echo '[Service]
Environment="TERM=xterm"' > /etc/systemd/system/serial-getty@ttyS0.service.d/xterm.conf
systemctl daemon-reload &&\
systemctl enable serial-getty@ttyS0.service &&\
systemctl start serial-getty@ttyS0.service &&\
systemctl status serial-getty@ttyS0.service
@leocomelli
leocomelli / git.md
Last active Aug 8, 2022
Lista de comandos úteis do GIT
View git.md

GIT

Estados

  • Modificado (modified);
  • Preparado (staged/index)
  • Consolidado (comitted);

Ajuda

@evaera
evaera / Clean Code.md
Last active Aug 8, 2022
Best Practices for Clean Code
View Clean Code.md
  1. Use descriptive and obvious names.
    • Don't use abbreviations, use full English words. player is better than plr.
    • Name things as directly as possible. wasCalled is better than hasBeenCalled. notify is better than doNotification.
    • Name booleans as if they are yes or no questions. isFirstRun is better than firstRun.
    • Name functions using verb forms: increment is better than plusOne. unzip is better than filesFromZip.
    • Name event handlers to express when they run. onClick is better than click.
    • Put statements and expressions in positive form.
      • isFlying instead of isNotFlying. late intead of notOnTime.
      • Lead with positive conditionals. Avoid if not something then ... else ... end.
  • If we only care about the inverse of a variable, turn it into a positive name. missingValue instead of not hasValue.
@reinvanoyen
reinvanoyen / terminal-prompt-git-branch-zsh.md
Last active Aug 8, 2022
Add Git Branch Name to Terminal Prompt (MacOS Catalina zsh)
View terminal-prompt-git-branch-zsh.md

Add Git Branch Name to Terminal Prompt (MacOS Catalina zsh)

screenshot

Open ~/.zshrc in your favorite editor and add the following content to the bottom.

function parse_git_branch() {
    git branch 2> /dev/null | sed -n -e 's/^\* \(.*\)/[\1]/p'
}
View jq-cheetsheet.md

Processing JSON using jq

jq is useful to slice, filter, map and transform structured json data.

Installing jq

On Mac OS

brew install jq