Skip to content

Instantly share code, notes, and snippets.

View savepong's full-sized avatar
:octocat:
savepong

Pongsiri Pisutakarathada savepong

:octocat:
savepong
View GitHub Profile
@savepong
savepong / showerror.php
Created March 8, 2017 09:43
PHP Show All Error
<?php
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
@savepong
savepong / modify_git.sh
Last active March 27, 2017 13:42
Bitbucket Modify your Git remote URLs
# 1. Navigate to your repository's directory in a terminal window using the command cd path/to/your/repository.
# 2. Run the following command (which modifies the fetch URL) from your terminal window:
# for SSH
git remote set-url origin git@bitbucket.org:{new team or account name}/{repository name}.git
# for HTTPS
git remote set-url origin https://{username}@bitbucket.org/{new team or account name}/{repository name}.git
# 3. Run the following command (which modifies the push URL) from your terminal window:
# for SSH
@savepong
savepong / date-only.sql
Created April 4, 2017 14:18
MySQL/SQL: Group by date only on a Datetime column
SELECT DATE(latest_update) DateOnly FROM users GROUP BY DateOnly LIMIT 10
@savepong
savepong / phalconphp_php7_ubuntu_16_04.sh
Created May 4, 2017 12:36 — forked from Tosyn/phalconphp_php7_ubuntu_16_04.sh
PhalconPhp with PHP7 Installation on Ubuntu 16.04
#!/bin/bash
# PhalconPhp with PHP7 installation on ubuntu:16.04
sudo apt-get update
sudo apt-get install -y php7.0-fpm \
php7.0-cli \
php7.0-curl \
php7.0-gd \
@savepong
savepong / sublime-cli.sh
Created June 1, 2017 06:21
Launch Sublime Text 3 from the command line
/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin
ln -s "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" /usr/local/bin/sublime
@savepong
savepong / remove-master-password.sh
Last active June 2, 2017 13:03
Master Password issues after upgrading to SmartSVN 9.1
rm /Users/[Your Mac]/Library/Preferences/SmartSVN/9.2/passwords
@savepong
savepong / key-bindings.sublime-keymap
Created November 14, 2017 05:44
Modified Sublime Key Bindings
[
{ "keys": ["ctrl+7"], "command": "toggle_comment", "args": { "block": false } },
{ "keys": ["command+shift+b"], "command": "reindent" , "args": {"single_line": false}},
{ "keys": ["ctrl+shift+7"], "command": "toggle_comment", "args": { "block": true } }
]
@savepong
savepong / AppServiceProvider.php
Last active January 9, 2018 09:49
Laravel : Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes
<?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
use Illuminate\Support\Facades\Schema;
class AppServiceProvider extends ServiceProvider
{
/**
@savepong
savepong / gist:9f2696549e25135906e5caa21773e3b0
Created March 8, 2018 15:02
Laravel 5.6 SendGrid Integate
# installed with composer
composer require s-ichikawa/laravel-sendgrid-driver
# Add the sendgrid service provider in config/app.php:
'providers' => [
Sichikawa\LaravelSendgridDriver\SendgridTransportServiceProvider::class
];
# Config on .env
MAIL_DRIVER=sendgrid
@savepong
savepong / 01.md
Created June 11, 2018 12:27 — forked from nasrulhazim/01.md
Laravel Default API Login

Setup

Migration

Create new migration script:

php artisan make:migration add_api_token --table=users