Skip to content

Instantly share code, notes, and snippets.

View dwihujianto's full-sized avatar
🌴
On vacation

Dwi Hujianto dwihujianto

🌴
On vacation
View GitHub Profile
@dwihujianto
dwihujianto / CronSchedule.php
Created December 11, 2018 09:30 — forked from m4tthumphrey/CronSchedule.php
CronSchedule.php - Allows one to parse a cron expression into human readable text.
<?php
/*
* Plugin: StreamlineFoundation
*
* Class: Schedule
*
* Description: Provides scheduling mechanics including creating a schedule, testing if a specific moment is part of the schedule, moving back
* and forth between scheduled moments in time and translating the created schedule back to a human readable form.
*
* Usage: ::fromCronString() creates a new Schedule class and requires a string in the cron ('* * * * *', $language) format.
@dwihujianto
dwihujianto / collection.php
Created October 26, 2018 10:05
Stupid Grouping Collection
<?php
$data = [
['account_number' => '123','account_name' => 'Panda Old Tra','detail' => 'Detail 1'],
['account_number' => '123','account_name' => 'Panda Old Tra','detail' => 'Detail 2'],
['account_number' => '123','account_name' => 'Panda Old Tra','detail' => 'Detail 3'],
['account_number' => '124','account_name' => 'Kucing','detail' => 'Detail 1'],
['account_number' => '124','account_name' => 'Kucing','detail' => 'Detail 2'],
['account_number' => '124','account_name' => 'Kucing','detail' => 'Detail 3'],
['account_number' => '125','account_name' => 'Anjing','detail' => 'Detail 1'],
['account_number' => '125','account_name' => 'Anjing','detail' => 'Detail 2'],
<?php
namespace App;
use Illuminate\Support\Arr;
use Illuminate\Support\Str;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Relations\Relation;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
@dwihujianto
dwihujianto / Command.php
Last active June 29, 2018 02:43
php request async
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
use GuzzleHttp\Client;
use function GuzzleHttp\Promise\each_limit;
class SendRequester extends Command
{
@dwihujianto
dwihujianto / mysql_backup.sh
Created April 20, 2018 14:20 — forked from tleish/mysql_backup.sh
Bash Script to backup all MySQL databases
#!/bin/bash
#==============================================================================
#TITLE: mysql_backup.sh
#DESCRIPTION: script for automating the daily mysql backups on development computer
#AUTHOR: tleish
#DATE: 2013-12-20
#VERSION: 0.4
#USAGE: ./mysql_backup.sh
#CRON:
# example cron for daily db backup @ 9:15 am
Number.prototype.toRupiah = function() {
return this.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g, "$1.")
}
<div class="alignleft action bulk-action">
<div class="posts-filter clearfix">
<select class="form-control" id="select-page">
<option {{ request('perPage') == 10 ? 'selected' : '' }} value="10">10</option>
<option {{ request('perPage') == 15 ? 'selected' : '' }} value="15">15</option>
<option {{ request('perPage') == 20 ? 'selected' : '' }} value="20">20</option>
<option {{ request('perPage') == 25 ? 'selected' : '' }} value="25">25</option>
</select>
</div>
</div>
<?php
// Keluaranya
echo $__env->yieldPushContent{$expression};;
// Pushnya dari sini
$__env->startPush{$expression};
$__env->stopPush();
<?php
namespace App\Http\Middleware;
use Closure;
use Illuminate\Support\Facades\Auth;
use Illuminate\Session\Store;
<?php
namespace App\Services;
use App\Models\Project;
use App\Models\User;
use LaravelFCM\Facades\FCM;
use LaravelFCM\Message\OptionsBuilder;
use LaravelFCM\Message\PayloadDataBuilder;
use LaravelFCM\Message\PayloadNotificationBuilder;