Skip to content

Instantly share code, notes, and snippets.

View ahmadrio's full-sized avatar
🇮🇩
Working from home

Ahmad Rio ahmadrio

🇮🇩
Working from home
View GitHub Profile
@ahmadrio
ahmadrio / .zshrc
Created February 11, 2022 03:46
Laravel Valet Switch PHP Version
# Function switch-php [to version] [from version]
# etc: switch-php php@7.1 php@7.4
switch-php() {
echo '----> Valet use php version'
valet use $1
echo '----> Stop valet'
valet stop
echo '----> Brew link/unlink php version'
# register your php version in your computer
@ahmadrio
ahmadrio / iterm2.md
Created January 14, 2022 17:29 — forked from squarism/iterm2.md
An iTerm2 Cheatsheet

Tabs and Windows

Function Shortcut
New Tab + T
Close Tab or Window + W (same as many mac apps)
Go to Tab + Number Key (ie: ⌘2 is 2nd tab)
Go to Split Pane by Direction + Option + Arrow Key
Cycle iTerm Windows + backtick (true of all mac apps and works with desktops/mission control)
@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
{
"success": true,
"message": "",
"data": {
"id": 2,
"name": "Dorokdok",
"price": "15.000",
"min_qty": 2,
"brand_name": "Sony",
"description": "s",

Keyboard Shortcuts for Sublime Text 3- OSX

Editing

Keypress Command
⌘ + X Delete line
⌘ + ↩ Insert line after
⌘ + ⇧ + ↩ Insert line before
⌘ + ⌃ + ↑ Move line/selection up
⌘ + ⌃ + ↓ Move line/selection down
<?php
namespace App;
use Illuminate\Notifications\Notifiable;
use Illuminate\Foundation\Auth\User as Authenticatable;
class User extends Authenticatable
{
use Notifiable;
<?php
use App\Helpers\Traits\SQLServerServices;
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class ChangeColumnInUsersTable extends Migration
{
<?php
namespace App\Helpers\Traits;
trait SQLServerService
{
/**
* Drop constraints default value column if exists
*
* @param $connection_name
<?php
namespace App\Http\Controllers\Post;
use Illuminate\Routing\Controller;
use Illuminate\Support\Facades\DB;
use Laravel\Nova\Actions\ActionEvent;
use Laravel\Nova\Http\Requests\UpdateResourceRequest;
class UpdateController extends Controller
<?php
namespace App\Http\Controllers\Post;
use Illuminate\Routing\Controller;
use Illuminate\Support\Facades\DB;
use Laravel\Nova\Actions\ActionEvent;
use Laravel\Nova\Http\Requests\CreateResourceRequest;
class StoreController extends Controller