Skip to content

Instantly share code, notes, and snippets.

View skylock's full-sized avatar

Emanuil Copil skylock

  • Cluj-Napoca, Romania
View GitHub Profile
@skylock
skylock / get-form-validation-errors.ts
Created June 6, 2024 13:51 — forked from domagoj03/get-form-validation-errors.ts
Get all validation errors for Angular FormGroup
import {FormGroup, ValidationErrors} from '@angular/forms';
export interface IFormError {
control: string;
error: string;
value: any;
}
export function getFormValidationErrors(form: FormGroup) {
const result = [];

Conventional Commit Messages

See how a minor change to your commit message style can make a difference.

Tip

Have a look at git-conventional-commits , a CLI util to ensure these conventions and generate verion and changelogs

Commit Message Formats

Default

@skylock
skylock / git-commit-styleguide.md
Created February 5, 2024 07:52 — forked from rishavpandey43/git-commit-styleguide.md
This gist consist of the rules and best practice of good conventional git commit message

Git Commit Messages Style-Guides

  • Use the present tense ("Add feature" not "Added feature")
  • Use the imperative mood ("Move cursor to..." not "Moves cursor to...")
  • Limit the first line to 72 characters or less
  • Reference issues and pull requests liberally after the first line
  • When only changing documentation, include [ci skip] in the commit title
  • Consider starting the commit message with an applicable emoji

Types

@skylock
skylock / squash-and-merge-cli.md
Created November 9, 2023 09:33 — forked from aortbals/squash-and-merge-cli.md
Squash and Merge on the Command line

With the introduction of GitHub's Squash and Merge feature, this has become less prevelant, however it's still useful in scenarios where GitHub's interface is unavailable.

Let's talk through two ways to do a squash and merge on the command line.

Take 1: Interactive Rebase

When to use it

  • When you have not merged main into your feature branch
  • There are no merge conflicts
@skylock
skylock / gist:9eb796604b5c240dd0cb92350c0abc07
Created July 7, 2022 09:25 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@skylock
skylock / docker-top.sh
Created June 19, 2020 13:14 — forked from jrenggli/docker-top.sh
List all running docker containers and their resources used
docker stats `docker inspect --format='{{.Name}}' $(sudo docker ps -aq --no-trunc) | sed -e 's/\///g'`
@skylock
skylock / create_new_ssh_key.md
Created April 23, 2018 06:01 — forked from JoaquimLey/create_new_ssh_key.md
Generating a new SSH key and adding it to the ssh-agent

##Generating a new ssh-key

Open Terminal. Paste the text below, substituting in your GitHub email address.

ssh-keygen -t rsa -b 4096 -C "[email protected]"

This creates a new ssh key, using the provided email as a label

Generating public/private rsa key pair.

@skylock
skylock / install.sh
Created April 20, 2018 14:26 — forked from wdullaer/install.sh
Install Latest Docker and Docker-compose on Ubuntu
# Ask for the user password
# Script only works if sudo caches the password for a few minutes
sudo true
# Install kernel extra's to enable docker aufs support
# sudo apt-get -y install linux-image-extra-$(uname -r)
# Add Docker PPA and install latest version
# sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9
# sudo sh -c "echo deb https://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/docker.list"
@skylock
skylock / docker-cleanup
Created April 20, 2018 14:25 — forked from wdullaer/docker-cleanup
Cleanup unused Docker images and containers
#!/bin/sh
# Cleanup docker files: untagged containers and images.
#
# Use `docker-cleanup -n` for a dry run to see what would be deleted.
untagged_containers() {
# Print containers using untagged images: $1 is used with awk's print: 0=line, 1=column 1.
# NOTE: "[0-9a-f]{12}" does not work with GNU Awk 3.1.7 (RHEL6).
# Ref: https://github.com/blueyed/dotfiles/commit/a14f0b4b#commitcomment-6736470
docker ps -a | tail -n +2 | awk '$2 ~ "^[0-9a-f]+$" {print $'$1'}'