Skip to content

Instantly share code, notes, and snippets.

View sixertoy's full-sized avatar
🏠
Working as #digital #nomad

Matthieu sixertoy

🏠
Working as #digital #nomad
  • Freelance
  • Montpellier - France
View GitHub Profile

GIT Aliases

~/.bash_profile

Show current GIT branch name

function git-name {
  git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
@sixertoy
sixertoy / capture-iterm-gif.md
Last active May 1, 2016 21:26
Capture terminal user input as gif

Install

brew install https://raw.githubusercontent.com/icholy/ttygif/master/ttygif.rb

Start Recording

@sixertoy
sixertoy / pre-push
Created May 2, 2016 09:14
GIT hook run tests before push
#!/bin/bash
# ----------------------------------
#
# pre-push hook running tests
#
git stash -q --keep-index
# NodeJS project
npm test
#!/usr/bin/env bash
# Add or remove keywords here
FORBIDDEN="console\.(debug|info|log|warn)\(|alert\(|debugger"
# Add extensions to check here
FILES_PATTERN="\.(js|coffee)(\..+)?$"
LINE=""
VERBOSE=false
ERRORS_BUFFER=""
# Using Bash
VERSION=$(npm version patch)
VERSION=$(echo $VERSION | cut -c 2-)
# Using NodeJS
PACKAGE_VERSION=$(node -p -e "require('./package.json').version")
#!/bin/bash
#
# Check if there's some unstaged/uncommitted changes
if [ -n "$(git status --porcelain)" ]; then
echo "[\033[1;31mPlease commit your changes before upgrading application version.\033[m";
exit 1;
fi
# npm version (major|minor|patch|premajor|preminor|prepatch|prerelease)
#!/bin/sh
#
# -----------------------------------------
#
#
# Check if git directory exists
# if not exists will create and init a new local repository
if [ ! -d "$DIRECTORY" ]; then
git init
@sixertoy
sixertoy / markdown-tree.sh
Created January 14, 2017 18:55
generate a folder tree for Markdown
tree -a -L 2
@sixertoy
sixertoy / README.md
Last active April 23, 2023 22:35
ES6 Tips & Tricks

JavaScript Tips

Yarn/NPM

Reorder package.json

npx sort-package-json

Array

@sixertoy
sixertoy / README.md
Last active May 18, 2018 08:36
A Collection of CSS Snippets

A Collection of CSS Snippets

  • Flexbox grid 4
  • Vertical Centered Elements
  • Eric Meyer's Reset 2.0
  • Preloader
  • Margin & Padding (SASS)
  • Speech Bubble (SASS)