Skip to content

Instantly share code, notes, and snippets.

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

Resa Rahman resarahman

🏠
Working from home
View GitHub Profile
@miftahafina
miftahafina / PendaftaranOnline.gs
Last active March 26, 2024 11:35
Input Data dari WhatsApp ke Google Sheet - Full Tutorial: https://youtu.be/UOpdL3wrivg
function doPost(e) {
// Buka sheet
let sheetUrl = "YOUR_SHEET_URL";
let file = SpreadsheetApp.openByUrl(sheetUrl);
let sheet = file.getSheetByName("Sheet1");
// Rapikan data
let req = JSON.stringify(e).replace(/\\/g, "").replace("}\"", "}").replace("\"{", "{");
let reqJson = JSON.parse(req);
let senderMessage = JSON.stringify(reqJson["postData"]["contents"]["senderMessage"]);
<?php
class SolusiPress_WA_Checkout {
protected $version = '0.9.2';
protected $wa_number = '6281314997198';
protected $resend_text = 'Click here if your browser not redirect to WhatsApp';
protected $wa_message_template = <<<EOT
Halo kak,
Berikut pesanan saya, mohon segera diproses
@maddisondesigns
maddisondesigns / functions.php
Last active February 7, 2024 13:42
WooCommerce Custom Fields for Simple & Variable Products
/*
* Add our Custom Fields to simple products
*/
function mytheme_woo_add_custom_fields() {
global $woocommerce, $post;
echo '<div class="options_group">';
// Text Field
@bhrott
bhrott / osx-disabling-gpg-for-commits.sh
Created February 11, 2017 22:49
OSX: disabling gpg for commits
!#/bin/bash
git config --global commit.gpgsign false
@ismailmechbal
ismailmechbal / sketch-never-ending.md
Last active January 28, 2022 04:23
Modify Sketch to never ending trial

###Sketch trial non stop

Open hosts files:

$ open /private/etc/hosts

Edit the file adding:

127.0.0.1 backend.bohemiancoding.com

127.0.0.1 bohemiancoding.sketch.analytics.s3-website-us-east-1.amazonaws.com

@champsupertramp
champsupertramp / Ultimate Member - UM Custom user query in Member Directory
Last active April 16, 2021 06:44
Ultimate Member - UM Custom user query in Member Directory
<?php
/**
* Show users with a Job Title "'WP Plugin developer " only
**/
add_filter('um_prepare_user_query_args', 'um_my_custom_query_args', 99, 2);
function um_my_custom_query_args( $query_args, $args ) {
if( $args["form_id"] == "1" ) { // you can validate the current member directory form ID
$query_args['meta_query'][] = array(
@itzikbenh
itzikbenh / functions.php
Last active January 25, 2020 00:20
WordPress auto-complete post search by title with typeahead-bootstrap
function theme_styles()
{
wp_enqueue_style( 'boostrap_css', 'https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css' );
wp_enqueue_style( 'theme_css', get_template_directory_uri() . '/css/theme.css' );
}
add_action( 'wp_enqueue_scripts', 'theme_styles' );
function theme_js()
{
@claudiosanches
claudiosanches / custom-my-account-endpoint.php
Last active April 30, 2024 03:05
Example of custom My Account endpoint.
<?php
class My_Custom_My_Account_Endpoint {
/**
* Custom endpoint name.
*
* @var string
*/
public static $endpoint = 'my-custom-endpoint';
@bmhatfield
bmhatfield / .profile
Last active May 6, 2024 22:27
Automatic Git commit signing with GPG on OSX
# In order for gpg to find gpg-agent, gpg-agent must be running, and there must be an env
# variable pointing GPG to the gpg-agent socket. This little script, which must be sourced
# in your shell's init script (ie, .bash_profile, .zshrc, whatever), will either start
# gpg-agent or set up the GPG_AGENT_INFO variable if it's already running.
# Add the following to your shell init to set up gpg-agent automatically for every shell
if [ -f ~/.gnupg/.gpg-agent-info ] && [ -n "$(pgrep gpg-agent)" ]; then
source ~/.gnupg/.gpg-agent-info
export GPG_AGENT_INFO
else
@paulirish
paulirish / what-forces-layout.md
Last active May 20, 2024 06:33
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent