Skip to content

Instantly share code, notes, and snippets.

@ahmadrio
ahmadrio / .zshrc
Last active January 15, 2023 15:41
My config for zsh and implement for switch-php version in laravel valet
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH="/Users/ahmadrio/.oh-my-zsh"
# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
# See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes
# source:
# https://discussions.apple.com/message/32354266#message32354266
sudo mdutil -Ea
sudo mdutil -ai off
sudo mdutil -ai on
@Lubje
Lubje / pre-commit
Last active July 9, 2023 05:11
git pre-commit hook
#!/usr/bin/env php
# Store in .git/hooks
<?php
echo "Step 1. Codestyle... ";
exec('docker exec -t spaarplanner-php php-cs-fixer fix --dry-run', $output, $returnCode);
if ($returnCode !== 0) {
echo "FAILED!" . PHP_EOL;
@WebSofter
WebSofter / ecosystem.config.json
Created October 28, 2019 13:47
Run laravel artisian serve script via pm2
{
"apps": [{
"name": "laravel-app",
"script": "artisan",
"args": ["serve", "--host=0.0.0.0", "--port=3333"],
"instances": "1",
"wait_ready": true,
"autorestart": false,
"max_restarts": 1,
"interpreter" : "php",
@jxlwqq
jxlwqq / admin.php
Last active June 3, 2023 19:05
Create upload path based on current year and month
<?php
return [
/*
|--------------------------------------------------------------------------
| Laravel-admin upload setting
|--------------------------------------------------------------------------
|
| File system configuration for form upload files and images, including
| disk and upload path.
|
@Bojole
Bojole / git-alias.sh
Last active October 27, 2022 18:51
Git Aliases
git config --global alias.a "! git add . && git status"
git config --global alias.aa "! git add . && git add -u . && git status"
git config --global alias.ac "! git add . && git commit"
git config --global alias.acm "! git add . && git commit -m"
git config --global alias.alias "! git config --list | grep 'alias\.' | sed 's/alias\.\([^=]*\)=\(.*\)/\1\ => \2/' | sort"
git config --global alias.au "! git add -u . && git status"
git config --global alias.c "commit"
git config --global alias.ca "commit --amend"
git config --global alias.cm "commit -m"
git config --global alias.co checkout
@miguelmota
miguelmota / surround_quotes.sql
Created April 21, 2018 01:03
PostgreSQL surround output with double quotes
SELECT CONCAT('"', email, '"') FROM email_list;
@SanderTheDragon
SanderTheDragon / postman-deb.sh
Last active April 3, 2024 05:30
A shellscript to create a Postman .deb file, for simple installation on Debian-based Linux distro's. Also creates a .desktop file.
#!/bin/sh
# SPDX-FileCopyrightText: 2017-2022 SanderTheDragon <sanderthedragon@zoho.com>
#
# SPDX-License-Identifier: MIT
curlExists=$(command -v curl)
echo "Testing Postman version"
@joshbuchea
joshbuchea / semantic-commit-messages.md
Last active May 7, 2024 17:49
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@tomysmile
tomysmile / mac-setup-redis.md
Last active March 18, 2024 22:12
Brew install Redis on Mac

type below:

brew update
brew install redis

To have launchd start redis now and restart at login:

brew services start redis