Skip to content

Instantly share code, notes, and snippets.

Avatar
🖥️
Working

Mior Muhammad Zaki crynobone

🖥️
Working
View GitHub Profile
@crynobone
crynobone / .env
Last active Oct 29, 2020
Using Minio for Laravel Vapor.
View .env
FILESYSTEM_DRIVER=minio
FILESYSTEM_CLOUD=minio
AWS_ACCESS_KEY_ID=minioadmin
AWS_SECRET_ACCESS_KEY=minioadmin
AWS_DEFAULT_REGION=us-east-1
AWS_BUCKET=local
AWS_ENDPOINT=http://127.0.0.1:9000
View SerializesQuery.php
<?php
use Illuminate\Database\Eloquent\Builder as EloquentBuilder;
use Illuminate\Database\Query\Builder as QueryBuilder;
use Illuminate\Database\Query\JoinClause;
use Illuminate\Queue\SerializableClosure;
use Illuminate\Support\Arr;
use Illuminate\Support\Facades\DB;
trait SerializesQuery
@crynobone
crynobone / UserRoles.php
Last active Sep 19, 2015
https://github.com/orchestral/authorization usage outside of Laravel or Orchestra Platform
View UserRoles.php
<?php
class UserRoles implements Orchestra\Contracts\Authorization\Authorizable
{
protected $roles;
public function __construct(array $roles)
{
$this->roles = $roles;
}
View git-fetch.md

Create a new project.

$ mkdir project
$ cd project

Create a default empty git repository.

$ git init .

Add upstream remote so we can fetch updated setup.

@crynobone
crynobone / composer.json
Last active Aug 29, 2015
Parsing Malaysia Public Holiday.
View composer.json
{
"authors": [
{
"name": "crynobone",
"email": "crynobone@gmail.com"
}
],
"require": {
"orchestra/parser": "~3.0"
},
View templated.php
<?php
/*
Name - templated.php
Author - Shafiq Mustapa (me@shafiqmustapa.my)
Usage - php templated.php
Stumble this upon site (http://templated.co)that offer over 800+ HTML5 + CSS + Responsive.
This php script will download the file automatically. For now, the page is now 7.
Tools
View ParseNotificationHandler.php
<?php
use GuzzleHttp\Client;
use Illuminate\Config\Repository;
use Illuminate\Events\Dispatcher;
class ParseNotificationHandler
{
/**
* Config repository.
@crynobone
crynobone / install-oci8.sh
Last active Oct 4, 2019
Provision Oracle InstantClient for Ubuntu Vagrant.
View install-oci8.sh
#!/usr/bin/env bash
export LD_LIBRARY_PATH=/opt/oracle/instantclient
export ORACLE_HOME=/opt/oracle/instantclient
echo "Instantclient path: instantclient,/opt/oracle/instantclient"
sudo pecl install oci8
sudo echo "extension=oci8.so" >> /etc/php5/fpm/php.ini
@crynobone
crynobone / update.sh
Created Feb 7, 2014
Laravel project deploy script
View update.sh
cd /var/www/project
composer self-update
php artisan down
rm /var/www/project/bootstrap/compiled.php
git reset --hard
git pull
echo "<?php return \"production\";" > bootstrap/environment.php
composer install --no-dev
find /var/www/project/public/packages -type d -exec chmod 775 {} \;
find /var/www/project/public/packages -type f -exec chmod 664 {} \;
View EmailNotifier.php
<?php
class EmailNotifier implements NotifierInterface {
public function send()
{
// send email.
}
}