Skip to content

Instantly share code, notes, and snippets.

View redpop's full-sized avatar

Martin Alker redpop

View GitHub Profile
alias php:7.4 'brew unlink php && brew link [email protected] --force --overwrite && php -v'
alias php:8 'brew unlink [email protected] && brew link php --force --overwrite && php -v'
let variables = Object.keys(window);
let sortedVariables = variables.sort((a, b) => {
if (a < b) return -1;
else if (a > b) return 1;
return 0;
});
console.log(sortedVariables);
command_timeout = 1000
[character]
success_symbol = "[➜](bold green) "
error_symbol = "[✗](bold red) "
[nodejs]
format = "via [🤖 $version](bold green) "
// Vanilla Throttle implementation
function throttle(func, wait = 100) {
let timer = null;
return function(...args) {
if (timer === null) {
timer = setTimeout(() => {
func.apply(this, args);
timer = null;
}, wait);
}
# https://joostvanveen.com/run-composer-1-and-2-simultaniously
brew cleanup
brew link --overwrite composer
ln -s /usr/local/bin/composer /usr/local/bin/composer2
COMPOSER_MEMORY_LIMIT=-1 composer upgrade
php -d memory_limit=-1 bin/console cache:clear
git ls-tree --full-tree -r --name-only HEAD
* {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
}
@redpop
redpop / docker_compose.sh
Created December 4, 2021 17:23
Docker compose snippets
# Docker Compose reuses anonymous volumes created by the previous containers for the new containers. This way the new cache container can reuse the cache from the old container. To force Docker Compose to renew anonymous volumes for the new containers, we use:
docker compose up --build --force-recreate -V
# -----------------------------------------------------------------------------
# Deploying changes
# When you make changes to your app code, remember to rebuild your image and recreate your app’s containers. To redeploy a service called web, use:
docker-compose build web
docker-compose up --no-deps -d web