Skip to content

Instantly share code, notes, and snippets.

View anovsiradj's full-sized avatar

MDMCDC anovsiradj

View GitHub Profile
@anovsiradj
anovsiradj / ModelFeeder.php
Last active May 30, 2023 12:36
Laravel command untuk melakukan seeder untuk semua model (secara manual)
<?php
namespace App\Console\Commands;
use App\Models\Kabupaten;
use App\Models\Provinsi;
use App\Models\User;
use Faker\Factory;
use Faker\Generator;
use Illuminate\Console\Command;
@anovsiradj
anovsiradj / README.md
Last active May 29, 2023 03:41
Firefox Request Blocker Rules
{
"fastScroll": "1",
"arrowScroll": "1",
"spaceScroll": "0",
"noAutofocus": "1",
"autoInstall": "1",
"analyticsConsent": "0",
"docs": "apache_http_server/css/deno/html/http/javascript/jquery/laravel~9/less~4/mariadb/php/postgresql~15/dom/yii~2.0/composer/node/npm/sqlite"
}
// @param st: The string that will be trimmed. @default whitespace
String.prototype.strim = function(st) {
st = st || "\\s";
return this.replace(new RegExp("^"+st+"+|"+st+"+$",'g'),'');
}
/*
example:
"alorem ipsuma".strim('a'); // return "lorem ipsum"
" lorem ipsum ".strim(); // return "lorem ipsum"
@anovsiradj
anovsiradj / main.dart
Created June 9, 2022 09:31
dynamic variable dumper
// https://stackoverflow.com/a/53765893
class _DumpV1 {
@override
noSuchMethod(Invocation invocation) {
print(invocation.memberName);
int index = invocation.memberName.toString().length;
for (final e in invocation.positionalArguments) {
print(e);
if (index < e.toString().length) index = e.toString().length;
if (index > 1024) index = 1024;
@anovsiradj
anovsiradj / main.dart
Created December 30, 2021 01:46
Konversi `Map<dynamic, dynamic>` ke `Map<String, String>`
/*
* melakukan konversi `Map<dynamic, dynamic>` ke `Map<String, String>`.
* dengan ketentuan, `null` harus menjadi `` (string kosong, bukan string `'null'`).
* yang digunakan sebagai body pada http-request.
*/
void main() {
Map<dynamic, dynamic> params = {
'null': null,
'int0': 0,
@anovsiradj
anovsiradj / main.dart
Created November 24, 2021 04:00
Dart NULL string is "null" as string
void main() {
String tmp;
print(tmp.toString());
print('null');
print(tmp.toString() == 'null');
}
@anovsiradj
anovsiradj / Default.sublime-keymap
Created March 14, 2021 09:56
Sublime Merge Override Shortcuts
[
{
"keys": ["ctrl+s"],
"command": "noop"
},
{
"keys": ["F4"],
"command": "noop"
},
{
@anovsiradj
anovsiradj / README.mkdn
Last active December 6, 2020 18:23
Video Zooming, Rotating, Positioning.

dailymotion

#player-body video 
{
	transform: scale(2);
	top: 100px !important;
	left: 0 !important;
}
@anovsiradj
anovsiradj / FTP_ZIP_X.php
Created November 12, 2020 20:30
FTP provided by free hosting service is always slooow also zip-extraction is very broken. Lets just let PHP do the work.
<?php
/**
*
* WARNING: DATA LOSS; (YOU HAVE BEEN WARNED)
*
* @version 20160124071141
* @version 20201023144831
* @author anovsiradj
* @author Touqeer Shafi