Skip to content

Instantly share code, notes, and snippets.

View crynobone's full-sized avatar
🖥️
Working

Mior Muhammad Zaki crynobone

🖥️
Working
View GitHub Profile
@crynobone
crynobone / .env
Last active June 10, 2022 11:46
Using Minio for Laravel Vapor.
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
<?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 September 19, 2015 16:11
https://github.com/orchestral/authorization usage outside of Laravel or Orchestra Platform
<?php
class UserRoles implements Orchestra\Contracts\Authorization\Authorizable
{
protected $roles;
public function __construct(array $roles)
{
$this->roles = $roles;
}

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 August 29, 2015 14:21
Parsing Malaysia Public Holiday.
{
"authors": [
{
"name": "crynobone",
"email": "[email protected]"
}
],
"require": {
"orchestra/parser": "~3.0"
},
<?php
/*
Name - templated.php
Author - Shafiq Mustapa ([email protected])
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
<?php
use GuzzleHttp\Client;
use Illuminate\Config\Repository;
use Illuminate\Events\Dispatcher;
class ParseNotificationHandler
{
/**
* Config repository.
@crynobone
crynobone / install-oci8.sh
Last active October 4, 2019 18:26
Provision Oracle InstantClient for Ubuntu Vagrant.
#!/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 February 7, 2014 01:08
Laravel project deploy script
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 {} \;
<?php
class EmailNotifier implements NotifierInterface {
public function send()
{
// send email.
}
}