This file contains hidden or 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 | |
# This script identifies and suggests deletion of remote Git branches | |
# that haven't been updated in a specified number of days. | |
usage() { | |
echo "Usage: $0 <stale_days> [--force] [--path=<repo_path>]" | |
echo " <stale_days>: REQUIRED. The number of days after which a branch is considered stale." | |
echo " --force: Optional. Execute the deletion commands. By default, a dry run is performed." | |
echo " --path=<repo_path>: Optional. Specify the path to the local Git repository (defaults to current directory)." |
This file contains hidden or 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 | |
trait OptionalProperties | |
{ | |
public static function fromArray(array $args = [], bool $strict = true): self | |
{ | |
$obj = (new ReflectionClass(self::class))->newInstanceWithoutConstructor(); | |
foreach ($args as $prop => $value) { | |
if (!property_exists($obj, $prop)) { | |
if ($strict) { |
This file contains hidden or 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
eval $(docker-machine env) | |
SSH_ENV=$HOME/.ssh/environment | |
force_color_prompt=yes | |
source /Library/Developer/CommandLineTools/usr/share/git-core/git-prompt.sh | |
PS1="\[\033[1;36m\]\u\[\033[1;35m\]@\[\033[1;34m\]#:\[\033[1;33m\]\w\[\033[1;32m\]\$(__git_ps1) \[\033[1;31m\]\$ \[\033[00m\]" | |
alias ls='ls --color=auto' |
This file contains hidden or 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 > if (!1 instanceof DumbClass) echo 'lolphp'; | |
PHP Fatal error: instanceof expects an object instance, constant given in php shell code on line 1 | |
php > $a = 1; if (!($a instanceof DumbClass)) echo 'lolphp'; // DumbClass has not been declared but not even a notice is thrown | |
lolphp |