Skip to content

Instantly share code, notes, and snippets.

View fiko's full-sized avatar

Fiko Borizqy fiko

View GitHub Profile
@fiko
fiko / Voyado Elevate Testing
Last active April 3, 2024 08:27
Voyado Elevate Testing
# Voyado Elevate Testing
@fiko
fiko / README.md
Last active April 1, 2024 15:15 — forked from Ademking/README.md
Laravel How to use Auto Increment with MongoDB (jenssegers)
  1. In your model, add these methods :
    /**
     * @var string this attribute used to define Primary Key of the collection
     */
    protected $primaryKey = '_id';

    /**
     * Generating next/new entity id
ServerAdmin hi@fiko.me
DocumentRoot /home/fiko/sites/project/middleman/public/
ServerName project.dev.fiko.me
#ServerAlias www.domain.com
<Directory /home/fiko/sites/project/middleman/public/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require all granted
</Directory>
@fiko
fiko / Laravel\.htaccess
Last active December 21, 2022 01:01
Basic htaccess files
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
RewriteEngine On
# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ /$1 [L,R=301]
@fiko
fiko / app\code\Fiko\Catalog\Block\SingleProduct.php
Created December 3, 2022 01:21
Magento 2 - Get Parent Product IDs
<?php
namespace Fiko\Catalog\Block;
use Fiko\Catalog\Helper\Data;
class SingleProduct
{
public function __construct(Data $helper)
{
@fiko
fiko / Magento244CodeSnifferPHP81.patch
Last active July 20, 2022 08:03
ERROR: Referenced sniff "PHPCompatibility.FunctionUse.RemovedFunctions" does not exist
diff --git a/vendor/squizlabs/php_codesniffer/src/Util/Standards.php b/vendor/squizlabs/php_codesniffer/src/Util/Standards.php
--- a/vendor/squizlabs/php_codesniffer/src/Util/Standards.php
+++ b/vendor/squizlabs/php_codesniffer/src/Util/Standards.php
@@ -33,6 +33,8 @@
}
$resolvedInstalledPaths = [];
+ $vendorDir = dirname(dirname(dirname(dirname(__DIR__))));
+ $phpCompatibilityDir = $vendorDir . '/phpcompatibility/php-compatibility/PHPCompatibility';
+ if (is_dir($phpCompatibilityDir)) {
@fiko
fiko / index.php
Last active June 20, 2022 09:23
How to backup database without mysqldump
<?php
# https://github.com/ifsnop/mysqldump-php
require_once('vendor/autoload.php');
use Ifsnop\Mysqldump as IMysqldump;
$host = 'localhost';
$db = 'database_name';
@fiko
fiko / Magento 2 - Quotes
Last active October 21, 2022 05:48 — forked from rafaelstz/Magento 2 - Remove all customer data
Remove all Magento 2 test Sample Data
SET FOREIGN_KEY_CHECKS = 0;
TRUNCATE TABLE `quote`;
TRUNCATE TABLE `quote_address`;
TRUNCATE TABLE `quote_address_item`;
TRUNCATE TABLE `quote_id_mask`;
TRUNCATE TABLE `quote_item`;
TRUNCATE TABLE `quote_item_option`;
TRUNCATE TABLE `quote_payment`;
TRUNCATE TABLE `quote_shipping_rate`;
@fiko
fiko / AutoLogin
Created April 14, 2022 22:58 — forked from akbaryahya/AutoLogin
Script Auto Login Wifi.id dengan Mikrotik
:local currentQueue 0;
:local nolock true;
:local gurl "https://welcome2.wifi.id";
:local guxx "http://www.msftconnecttest.com/redirect";
:local username "";
:local password "";
:local int "WIFI";
:local gwp "WAG-DX-PTR";
:local mdlan "MSTMA000xx-N/TLK-CI-xx33x:xxx";
:local type "WzMS";
server {
listen 80;
{{ssl_listener}}
server_name local.replace.me;
{{ssl_certificate}}
{{ssl_certificate_key}}
ssl_session_cache builtin:1000 shared:SSL:10m;
ssl_session_timeout 10m;
ssl_protocols TLSv1.1 TLSv1.2;
ssl_ciphers 'ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128:AES256:AES:DES-CBC3-SHA:HIGH:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK';