This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Check https://github.com/filipekiss/bin/blob/main/git-delete-merged-branches for a better version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
for branch in `git branch -r | grep -v HEAD | grep -v master`; do | |
echo ${branch##*/} $branch | |
done | |
echo "Fetching..." | |
git fetch --all | |
echo "Pulling..." | |
git pull -v | |
echo "Results: Branches" | |
git branch -a |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
...\...../ | |
....╚⊙ ⊙╝ | |
..╚═(███)═╝ | |
.╚═(███)═╝ | |
╚═(███)═╝ | |
.╚═(███)═╝ | |
..╚═(███)═╝ | |
...╚═(███)═╝ | |
...╚═(███)═╝ | |
..╚═(███)═╝ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function remove_emoji($text){ | |
return preg_replace('/([0-9|#][\x{20E3}])|[\x{00ae}|\x{00a9}|\x{203C}|\x{2047}|\x{2048}|\x{2049}|\x{3030}|\x{303D}|\x{2139}|\x{2122}|\x{3297}|\x{3299}][\x{FE00}-\x{FEFF}]?|[\x{2190}-\x{21FF}][\x{FE00}-\x{FEFF}]?|[\x{2300}-\x{23FF}][\x{FE00}-\x{FEFF}]?|[\x{2460}-\x{24FF}][\x{FE00}-\x{FEFF}]?|[\x{25A0}-\x{25FF}][\x{FE00}-\x{FEFF}]?|[\x{2600}-\x{27BF}][\x{FE00}-\x{FEFF}]?|[\x{2900}-\x{297F}][\x{FE00}-\x{FEFF}]?|[\x{2B00}-\x{2BF0}][\x{FE00}-\x{FEFF}]?|[\x{1F000}-\x{1F6FF}][\x{FE00}-\x{FEFF}]?/u', '', $text); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
stagedFiles=$(git diff-index --cached HEAD | grep ".php" | grep "^:" | sed 's:.*[DAM][ \\''t]*\([^ \\''t]*\):\1:g'); | |
phpLintErrors=0 | |
echo "PHP will now lint all the php staged files..." | |
echo "" | |
for file in $stagedFiles | |
do | |
echo "PHP is linting $file..."; | |
echo "" | |
php -l $file |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"x": "--", | |
"function": "concat", | |
"y": { | |
"x": { | |
"function": "strreplace", | |
"x": { | |
"function": "lower", | |
"x": "[name]", | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# | |
# A simple activity indicator for bash scripting. | |
# Optional message can be passed to spinner function. | |
# This can be used on interactive shells and in scripts | |
# | |
# Scripting usage: | |
# | |
# e_spinner "Import MySQL" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$uri = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH); | |
$uri = urldecode($uri); | |
$requested = './'.$uri; | |
//Redirect if no trailing slash is found |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
=size($property , $size, $size-right: false, $size-bottom: false, $size-left: false) | |
@if $size == $size-bottom and $size-right == $size-left //Check if we can discard size-bottom | |
$size-bottom: false | |
@if $size-right == $size-left //If horizontal sizes are equal we only need one of the properties | |
$size-left: false | |
@if $size and $size-right == false //All equal | |
#{$property}: $size * 1px | |
#{$property}: $size * 0.1rem | |
@if $size and $size-right != false and $size-bottom == false // Vertical and Horizontal | |
#{$property}: $size * 1px $size-right * 1px |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Based on https://gist.github.com/DNA/7616b825261f97223953 | |
# Improvements: | |
# - Capture up to 2 screens | |
# - Variable configuration for the binaries path | |
TODAY_SCREENCAPTURE_FOLDER="$HOME/Dropbox/Autophoto/screen/$(date +%Y%m%d)"; | |
TODAY_SNAPS_FOLDER="$HOME/Dropbox/Autophoto/snaps/$(date +%Y%m%d)"; | |
SCREENCAPTURE_BIN="/usr/sbin/screencapture" |
NewerOlder