Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env bash
# Back up Script to Amazon S3
# Source:
# Author: Amit
#create array of sites based on folder names
SITELIST=($(ee site list --enabled | sed 's/\x1b\[[0-9;]*[a-zA-Z]//g'))
for SITE in ${SITELIST[@]}; do
ee site info $SITE
@thecancerus
thecancerus / update-aw3.sh
Created January 28, 2021 11:32
bash script to update the awesome enterprise 3 from composer
#!/bin/bash
#
#color codes
CYANBG='\033[0;96m'
GREEN='\033[0;92m'
YELLOW='\033[0;33m'
ORANGE='\033[38;5;208m'
NC='\033[0m' # No Color
DATE=$(date +%d%m%Y)
@thecancerus
thecancerus / sequential.js
Created February 7, 2022 06:22 — forked from niraj-shah/sequential.js
Sequential Ajax Calls using jQuery
// parameters for ajax calls
var items = [
{ 'gender': 'male', 'nat': 'US' },
{ 'gender': 'female', 'nat': 'GB' }
];
// function to trigger the ajax call
var ajax_request = function(item) {
var deferred = $.Deferred();
#!/bin/sh
# /etc/nginx/geoip_update.sh
# Update GeoIP proxy list to the current list of cloudflare IP addresses
outfile=$(dirname "$0")/cloudflare_proxy_ips.conf
echo "# Auto-generated by $0" > "$outfile"
(
curl https://www.cloudflare.com/ips-v4
) | while read ip; do
@thecancerus
thecancerus / gist:e9ff10441b2016ccc9bab1e766a48af1
Created June 13, 2024 16:30
Event ticket RSVP to Fluent CRM integration
add_action('event_tickets_rsvp_attendee_created', 'awesome_trigger_attendee', 11,3);
function awesome_trigger_attendee($attendee_id, $event_id, $order_id ){
$attendee_post = get_post($attendee_id);
$trb = new Tribe__Tickets__RSVP();
$attendee = $trb->get_attendee($attendee_id);
$data['first_name']=$attendee['holder_name'];
@thecancerus
thecancerus / gist:7ea209660750a7a7d524e0fd8027d4c9
Created July 25, 2024 12:02
add the following code in functions.php file of monomyth theme to fix the hreflang urls issue for polylang plugin.
add_filter( 'pll_rel_hreflang_attributes', function( $hreflangs ) {
$app_slug=aw2_library::get('app.slug');
if($app_slug == 'root') return $hreflangs;
$default_lang = pll_default_language();
$hreflangs_new = array();
foreach($hreflangs as $key=>$url){
$url_slug = site_url().'/'.$key;