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
install: | |
gcc helloWorld.c -o ./opt |
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
# Remove all containers | |
docker rm $(docker ps -aq) | |
# Remove all images | |
docker rmi $(docker images -q) | |
# Remove the following: | |
# - all stopped containers | |
# - all volumes not used by at least one container | |
# - all networks not used by at least one container |
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
# Laravel Envoyer - Fix Log Permissions: | |
# --- | |
# Sets up access control restrictions, so both the deployment user 'forge' | |
# and the web-server's user 'www-data' can access generated log files. | |
PROJECT_DIRS="storage" | |
RELEASE_DIRS="bootstrap/cache" | |
cd {{ project }} | |
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
# Silence bash deprecation warning (MacOS) | |
export BASH_SILENCE_DEPRECATION_WARNING=1 |
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
# Add yarn to global path | |
export="${PATH}:$(yarn global bin)" |
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
/* | |
* Returns an array of unique values from the provided array. | |
* | |
* @param input {array} Array of values | |
* @returns {array} Array of unique values | |
*/ | |
const unique = (input) => [...new Set(input)]; | |
unique([1, 1, 2, 2, 3, 4]); // => [1, 2, 3, 4] |
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
# Opens the provided directory in PHPStorm. If PHPStorm is not currently running | |
# the application will be opened. If PHPStorm is already running, the provided | |
# directory will be opened in a new project window. | |
# | |
# Examples: | |
# Relative path: pstorm . | |
# Absolute path: pstorm ~/Projects/my-project | |
function pstorm () { | |
open -a PhpStorm $1 |
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 | |
// Initialize variable to null | |
$empty = null; | |
foreach ($empty ?? [] as $item) { | |
// Line never executed | |
} | |
// No error encountered |
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
# Adds git branch to PS1 output | |
git_branch() { | |
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/' | |
} | |
export PS1="\[\e]0;\u@\h: \w\a\]${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\$ " |
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
# Frees up the provided port by killing whatever process is blocking it. | |
# | |
# Example: | |
# freeport 8080 | |
function freeport () { | |
local result=$(lsof -i :$1 | grep node | awk '{print $2}') | |
if [[ ! -z $result ]]; then | |
kill $result |