Skip to content

Instantly share code, notes, and snippets.

View madebyaris's full-sized avatar
🚀
Available to create Awesome app

Aris Setiawan madebyaris

🚀
Available to create Awesome app
View GitHub Profile
@madebyaris
madebyaris / auto-mode-complex.mdc
Last active September 27, 2025 09:02
Enhance the power of Auto model of Cursor via this awesome rule.
---
title: Auto-Mode Complex
description: Comprehensive AI development methodology focusing on systematic codebase analysis, strategic planning, and 10X developer practices
globs: ["**/*.*"]
alwaysApply: true
---
# Auto-Mode Complex: 10X Developer AI Methodology
## 🧠 **Core Philosophy: Think Like a 10X Developer**
@madebyaris
madebyaris / README.md
Last active February 15, 2024 02:26 — forked from pauln/README.md
Simple WordPress bulk insert function

Simple WordPress Bulk Insert

A very simple function to perform bulk SQL inserts, since WPDB doesn't provide one directly. The aim is for simplicity - both in the function itself, and in using it - rather than being a massive beast which covers all possible incorrect usage scenarios. Provide it with clean, consistent data, and it should hopefully be able to do what you want without issue.

Notes:

  • Provide a table name and an array of associative arrays of rows to insert
  • Column names are pulled from the first row of data automatically
  • Make sure you provide the same fields in each row (there's no protection for this)
  • Data types (for WPDB placeholders) are auto-detected for each individual value (using is_numeric())
  • There is no protection for exceeding maximum query size (i.e. MySQL's max_allowed_packet); you could pre-batch into smaller "safe" chunks if you need to handle this case - or just find a better way to insert such a large amount of data
@madebyaris
madebyaris / header-nginx.conf
Last active May 6, 2021 03:15
Header rule for prevent XSS ~ Nginx ( WordPress ♥ )
server
{
listen 80;
listen 443 ssl http2;
#.
#.
#.
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload";
add_header X-Frame-Options SAMEORIGIN;
add_header X-Content-Type-Options nosniff;
@madebyaris
madebyaris / awesome.txt
Created July 9, 2020 19:34
git profile
AWESOME DEVELOPER
@madebyaris
madebyaris / PHP composer tools.md
Created January 26, 2019 13:15 — forked from davebarnwell/PHP composer tools.md
Global installation of PHP tools with Composer

Global installation of PHP tools with Composer

To install a composer package globally, you run the usual require command, but with the addition of the global modifier. So to install PHPUnit, you would run:

$ composer global require phpunit/phpunit
$ composer global require phpunit/dbunit
$ composer global require phing/phing
$ composer global require phpdocumentor/phpdocumentor
$ composer global require sebastian/phpcpd
@madebyaris
madebyaris / get_current_post_type.php
Created January 23, 2019 03:38 — forked from DomenicF/get_current_post_type.php
Get the current post_type context in the WordPress admin.
<?php
/**
* gets the current post type in the WordPress Admin
*/
function get_current_post_type() {
global $post, $typenow, $current_screen;
//we have a post so we can just get the post type from that
if ( $post && $post->post_type ) {
return $post->post_type;
@madebyaris
madebyaris / dump.sh
Created November 20, 2018 00:07 — forked from andsens/dump.sh
Backup all MySQL databases into separate files
#!/bin/sh
## backup each mysql db into a different file, rather than one big file
## as with --all-databases. This will make restores easier.
## To backup a single database simply add the db name as a parameter (or multiple dbs)
## Putting the script in /var/backups/mysql seems sensible... on a debian machine that is
## Create the user and directories
# mkdir -p /var/backups/mysql/databases
# useradd --home-dir /var/backups/mysql --gid backup --no-create-home mysql-backup
## Remember to make the script executable, and unreadable by others
@madebyaris
madebyaris / multisite_wp_user_register.php
Last active July 26, 2018 04:06
when user registered from site, they will added to other site as well
<?php
// same as above, except this is only for register user
add_action( 'user_register', 'sync_user_all_networks_register', 10, 1 );
function sync_user_all_networks_register( $user_id ) {
$current_blog_id = get_current_blog_id();
$sites = get_sites();
$user_role = $_REQUEST['role'];
$user_id = (int)$user_id;
foreach( $sites as $site ) {
@madebyaris
madebyaris / ubuntu httacess error
Created May 30, 2017 06:15
when you update php version, some of feature may disable
try this to re active mod_rewrite
4
down vote
For Ubuntu,
First, run this command :-
sudo a2enmod rewrite
@madebyaris
madebyaris / gist:ce062af77dc0669bcd45c3a30c76b635
Created April 29, 2017 23:00
vscode - add color for selector in html
My friends notice in Vscode, it's hard to seeing where's the end of tag that we choose. for example
`<div>
<div>
love is love
</div>
</div>`
when you select the top div, it will look like that you select every div, so how I solve this ?
follow this instruction :