Skip to content

Instantly share code, notes, and snippets.

View gasatrya's full-sized avatar
🏠
Working from home

Ga Satrya gasatrya

🏠
Working from home
View GitHub Profile
@mattstobbs
mattstobbs / month-picker.tsx
Created July 26, 2023 22:15
A simple month picker that matches the style of shadcn/ui
import {
add,
eachMonthOfInterval,
endOfYear,
format,
isEqual,
isFuture,
parse,
startOfMonth,
startOfToday,
<?php
add_filter(
'forminator_cform_render_fields',
function( $wrappers, $model_id ) {
if( $model_id != 1441 ){
return $wrappers;
}
$select_fields_data = array(
@tuantmb
tuantmb / Install_checkpoint_VPN_Client_in_Ubuntu_19.md
Last active September 7, 2024 17:13
Install Checkpoint VPN client in Ubuntu 19.x
  1. Download your install script from your vpn website See Download SSL Network Extender manual installation in the right pane on your vpn.{your-company.com} (replace with your company vpn url) ==> click Download command line SNX for Linux (usually get a script name snx_install.sh but it can change because of your company's settings)
If you don't see any similar section on your vpn  website, 
DON'T try to search and get script from interne.
==> look up in checkpoint website for safe and avoid viruses or contact to your administrators.
@wpmudev-sls
wpmudev-sls / wpmudev-forminator-send-input-ajax-request.php
Created March 11, 2020 11:48
[Forminator Pro] - Make an AJAX request upon an input
<?php
/**
* Plugin Name: [Forminator Pro] - Make an AJAX request upon an input
* Plugin URI: https://premium.wpmudev.org/
* Description: Send an AJAX request when an input is filled (as of 1.11.3)
* Author: Alessandro Kaounas @ WPMUDEV
* Author URI: https://premium.wpmudev.org/
* Task: 0/1135022585412927/1164144055767340
* License: GPLv2 or later
*/
@leodutra
leodutra / -setup-windows-wsl-devenv.md
Last active August 3, 2024 21:31
Install and Setup Windows Subsystem 2 for Linux, Hyper, ZSH + Oh My Zsh + Powerlevel9k + plugins, FNM + VSCode (+ext) and Nerd Font

Setup Windows Subsystem 2 for Linux

Windows Subsystem 2 for Linux, Hyper, ZSH + Oh My Zsh + Powerlevel9k + plugins, FNM + VSCode (+ext) and Nerd Font

To setup native Linux, see this gist

Preview

Requirements

@wpmudev-sls
wpmudev-sls / frmt-limit-form-sub.php
Created June 6, 2019 18:22
Forminator - Limit form submissions per IP for 24 hours.
<?php
/**
* Plugin Name: Forminator
* Description: Limit form submissions per IP for 24 hours.
* Author: Konstantinos Xenos @ WPMUDEV
* Author URI: https://premium.wpmudev.org
* License: GPLv2 or later
*/
@PARC6502
PARC6502 / OpenSourceBaas.md
Last active September 19, 2024 01:16
List of open source, self hosted BaaS - Backend as a service

Backend as a Service

Supabase - ~52K stars

  • Designed explicitly as an open source firebase alternative
  • Typescript based
  • Docker support

Appwrite - ~32K stars

  • Written in JavaScript and PHP
  • Docker based
  • Realtime support across all services
@jeromecoupe
jeromecoupe / webstoemp-gulpfile.js
Last active August 22, 2024 18:59
Gulp 4 sample gulpfile.js. For a full explanation, have a look at https://www.webstoemp.com/blog/switching-to-gulp4/
"use strict";
// Load plugins
const autoprefixer = require("autoprefixer");
const browsersync = require("browser-sync").create();
const cp = require("child_process");
const cssnano = require("cssnano");
const del = require("del");
const eslint = require("gulp-eslint");
const gulp = require("gulp");
@devinsays
devinsays / estimate-read-time.php
Last active February 11, 2023 20:57
WordPress Estimated Read Time
<?php
/**
* Estimates the reading time for a given piece of $content.
*
* @param string $content Content to calculate read time for.
* @param int $wpm Estimated words per minute of reader.
*
* @returns int $time Esimated reading time.
*/
function prefix_estimated_reading_time( $content = '', $wpm = 300 ) {
@lukecav
lukecav / Query
Last active July 11, 2024 16:45
MySQL script to get all WooCommerce orders including metadata
select
p.ID as order_id,
p.post_date,
max( CASE WHEN pm.meta_key = '_billing_email' and p.ID = pm.post_id THEN pm.meta_value END ) as billing_email,
max( CASE WHEN pm.meta_key = '_billing_first_name' and p.ID = pm.post_id THEN pm.meta_value END ) as _billing_first_name,
max( CASE WHEN pm.meta_key = '_billing_last_name' and p.ID = pm.post_id THEN pm.meta_value END ) as _billing_last_name,
max( CASE WHEN pm.meta_key = '_billing_address_1' and p.ID = pm.post_id THEN pm.meta_value END ) as _billing_address_1,
max( CASE WHEN pm.meta_key = '_billing_address_2' and p.ID = pm.post_id THEN pm.meta_value END ) as _billing_address_2,
max( CASE WHEN pm.meta_key = '_billing_city' and p.ID = pm.post_id THEN pm.meta_value END ) as _billing_city,
max( CASE WHEN pm.meta_key = '_billing_state' and p.ID = pm.post_id THEN pm.meta_value END ) as _billing_state,