Skip to content

Instantly share code, notes, and snippets.

View sumonst21's full-sized avatar
💭
I may be slow to respond.

Md. Sumon Islam sumonst21

💭
I may be slow to respond.
View GitHub Profile
@sumonst21
sumonst21 / clickTrackEvents.js
Created April 20, 2022 09:14 — forked from jwebgordon/clickTrackEvents.js
Custom JS to add click track event listeners to all elements of a particular class This should be added to the Custom Javascript in Hubspot Events
var all_buttons = $('.buttons');
for(var i=0; i<all_buttons.length; i++){
_hsq.push(["trackClick", "#"+all_buttons.eq(i).attr('id'), "test2"+all_buttons.eq(i).attr('id')]);
}
@sumonst21
sumonst21 / hubspot.css
Created April 20, 2022 09:08 — forked from jwebgordon/hubspot.css
HS style guide
@charset "UTF-8";
html, body {
margin: 0;
padding: 0
}
h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, cite, code, del, dfn, em, img, q, s, samp, small, strike, strong, sub, sup, tt, var, dd, dl, dt, li, ol, ul, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td {
margin: 0;
padding: 0;
border: 0;
font-weight: normal;
@sumonst21
sumonst21 / desc.php
Created April 16, 2022 19:05 — forked from igorbenic/desc.php
How to Programmatically Change Yoast SEO Open Graph Meta | http://www.ibenic.com/programmatically-change-yoast-seo-open-graph-meta
<?php
function change_yoast_seo_og_meta() {
add_filter( 'wpseo_opengraph_desc', 'change_desc' );
}
function change_desc( $desc ) {
// This article is actually a landing page for an eBook
if( is_singular( 123 ) ) {
@sumonst21
sumonst21 / ubuntu16-apache2-mysql5-php4.md
Created April 10, 2022 21:02 — forked from samueltc/ubuntu16-apache2-mysql5-php4.md
Ubuntu 16.04, Apache 2.2, MySQL 5.0 and PHP 4.4
# lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 16.04.5 LTS
Release:	16.04
Codename:	xenial

apt-get update
apt-get upgrade
@sumonst21
sumonst21 / proxmox-proxy
Created March 29, 2022 19:28 — forked from basoro/proxmox-proxy
Running Proxmox behind a single IP address
I ran into the battle of running all of my VMs and the host node under a single public IP address. Luckily, the host is just pure Debian, and ships with iptables.
What needs to be done is essentially to run all the VMs on a private internal network. Outbound internet access is done via NAT. Inbound access is via port forwarding.
Network configuration
Here’s how it’s done:
Create a virtual interface that serves as the gateway for your VMs:
@sumonst21
sumonst21 / wordpress-upload-base64.php
Created March 28, 2022 10:51 — forked from cyberwani/wordpress-upload-base64.php
Upload a base64 string as image to the WordPress media library
<?php
/**
* Save the image on the server.
*/
function save_image( $base64_img, $title ) {
// Upload dir.
$upload_dir = wp_upload_dir();
$upload_path = str_replace( '/', DIRECTORY_SEPARATOR, $upload_dir['path'] ) . DIRECTORY_SEPARATOR;
@sumonst21
sumonst21 / 503.html
Created March 20, 2022 14:42
Error 503 - Service unavailable.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Service Unavailable</title>
<link href="https://fonts.googleapis.com/css?family=Roboto:400,700" rel="stylesheet">
<link href="https://use.fontawesome.com/releases/v5.2.0/css/all.css" rel="stylesheet" integrity="sha384-hWVjflwFxL6sNzntih27bfxkr27PmbbK/iSvJ+a4+0owXq79v+lsFkW54bOGbiDQ" crossorigin="anonymous">
<style>
html{min-height:100%;height:100%}body{background:#333;color:#333;height:inherit;font:400 16px/1em "Roboto",Arial,sans-serif;margin:0;min-height:inherit}a{color:#17a8e3;display:inline-block;text-decoration:none;-webkit-transition:color 0.2s;-o-transition:color 0.2s;transition:color 0.2s}a:focus,a:hover{color:#1999CD;text-decoration:none}.wrapper{-webkit-box-align:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;height:inherit;padding:0 30px}.content{color:#f5f5f5;margin:auto;text-align:center}.co
@sumonst21
sumonst21 / README.md
Created March 18, 2022 12:19 — forked from signalpoint/README.md
Bootstrap 4 Dynamic Modal with JavaScript

Use this to dynamically create and set the content of a Bootstrap 4 Modal.

In this example, we chose an onclick handler to initialize the modal (only once), and then set the content of the modal dynamically.

@sumonst21
sumonst21 / wc-auth-net-cim-save-payment-method-default-checked.php
Created March 15, 2022 22:00 — forked from maxrice/wc-auth-net-cim-save-payment-method-default-checked.php
WC Authorize.net CIM: On the payment form, default "securely save to account" checkbox to checked
<?php
// force the "securely save to account" checkbox to default to checked
function wc_auth_net_cim_save_payment_method_default_checked( $html, $form ) {
if ( empty( $html ) || $form->tokenization_forced() ) {
return $html;
}
return str_replace( 'type="checkbox"', 'type="checkbox" checked="checked"', $html );
}
@sumonst21
sumonst21 / wc-auth-net-cim-adjust-auth-only-order-status.php
Created March 15, 2022 21:59 — forked from maxrice/wc-auth-net-cim-adjust-auth-only-order-status.php
WooCommerce Authorize.net CIM: Adjust authorize-only transaction order status
<?php
function sv_wc_auth_net_cim_tweak_held_order_status( $order_status, $order, $response ) {
if ( 'on-hold' === $order_status && $response instanceof SV_WC_Payment_Gateway_API_Response && $response->transaction_approved() ) {
$order_status = 'processing';
}
return $order_status;
}