Skip to content

Instantly share code, notes, and snippets.

View zulfikar-ditya's full-sized avatar
:octocat:
200 - Response ok

Zulfikar Ditya zulfikar-ditya

:octocat:
200 - Response ok
View GitHub Profile
@MrPunyapal
MrPunyapal / LaravelWhereLikeMacro.php
Last active April 12, 2024 03:32
Laravel Custom 'whereLike' Macro for Dynamic 'LIKE' Searches including relationships
<?php
namespace App\Providers;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Support\Arr;
use Illuminate\Support\ServiceProvider;
class AppServiceProvider extends ServiceProvider
{
@defrindr
defrindr / mover
Last active May 15, 2024 16:09
file mover from git commit history
#!/usr/bin/env php
<?php
/**
* WHAT IT IS:
* Tool untuk memindahkan file yang berubah pada suatu commit, untuk mempermudah upload file.
* HOW TO USE :
* ./mover [commit_start] [commit_end]
*/
@yudapc
yudapc / Javascript Format NPWP
Last active November 16, 2023 03:21
Javascript Format NPWP. NPWP is ID tax each people of indonesian. Specificly in frontend need to format NPWP before render to user
//
// Javascript Format NPWP
//
function formatNpwp(value) {
if (typeof value === 'string') {
return value.replace(/(\d{2})(\d{3})(\d{3})(\d{1})(\d{3})(\d{3})/, '$1.$2.$3.$4-$5.$6');
}
}
@diogocapela
diogocapela / moment-js-timezones.txt
Created September 7, 2018 00:10
List of All Moment.js Timezones
Africa/Abidjan
Africa/Accra
Africa/Addis_Ababa
Africa/Algiers
Africa/Asmara
Africa/Asmera
Africa/Bamako
Africa/Bangui
Africa/Banjul
Africa/Bissau
@cahsowan
cahsowan / terbilang.php
Created April 21, 2015 04:16
Fungsi Terbilang Dengan PHP
<?php
function terbilang($x) {
$angka = ["", "satu", "dua", "tiga", "empat", "lima", "enam", "tujuh", "delapan", "sembilan", "sepuluh", "sebelas"];
if ($x < 12)
return " " . $angka[$x];
elseif ($x < 20)
return terbilang($x - 10) . " belas";
elseif ($x < 100)
@ksafranski
ksafranski / Common-Currency.json
Last active June 12, 2024 16:45
Common Currency Codes in JSON
{
"USD": {
"symbol": "$",
"name": "US Dollar",
"symbol_native": "$",
"decimal_digits": 2,
"rounding": 0,
"code": "USD",
"name_plural": "US dollars"
},
@keeguon
keeguon / countries.json
Created April 5, 2012 11:11
A list of countries in JSON
[
{name: 'Afghanistan', code: 'AF'},
{name: 'Åland Islands', code: 'AX'},
{name: 'Albania', code: 'AL'},
{name: 'Algeria', code: 'DZ'},
{name: 'American Samoa', code: 'AS'},
{name: 'AndorrA', code: 'AD'},
{name: 'Angola', code: 'AO'},
{name: 'Anguilla', code: 'AI'},
{name: 'Antarctica', code: 'AQ'},