Skip to content

Instantly share code, notes, and snippets.

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

Aadil Prabhakar aadilprabhakar

💭
I may be slow to respond.
  • India
View GitHub Profile
@aadilprabhakar
aadilprabhakar / gist:43ad3fe64c404bf29199dd4298b0ea3a
Created July 11, 2019 14:05
RSync via SSH (Use case - push files to self-hosted CDN)
#!/bin/bash
####################################
# Rsync media to CDN
####################################
rsync -avzhe ssh /livehost/wp-content/uploads/ cdnuser@cdnhost:/cdnhost/wp-content/uploads/
rsync -avzhe ssh /livehost/wp-content/plugins/ cdnuser@cdnhost:/cdnhost/wp-content/plugins/
rsync -avzhe ssh /livehost/wp-content/themes/ cdnuser@cdnhost:/cdnhost/wp-content/themes/
rsync -avzhe ssh /livehost/wp-content/mu-plugins/ cdnuser@cdnhost:/cdnhost/wp-content/mu-plugins/
rsync -avzhe ssh /livehost/wp-includes/ cdnuser@cdnhost:/cdnhost/wp-includes/
@aadilprabhakar
aadilprabhakar / include-in-theme-functions.php
Last active February 5, 2018 11:15
Combine+Minify styles of parent theme and add as inline-style in wordpress
function parent_style_cache() {
global $wp_styles, $wpdb;
$updateFlag = 0;
$returnCss = null;
/**
* Check if our table exists else create
*/
@aadilprabhakar
aadilprabhakar / gist:2bbd0f81257279e99e7de9df4bbf7887
Created January 8, 2018 10:41
India - State name vs Gst Code ( PHP Array )
$gstStateVsCode = [
'Andaman and Nicobar Islands' => 35,
'Andhra Pradesh' => 37,
'Arunachal Pradesh' => 12,
'Assam' => 18,
'Bihar' => 10,
'Chandigarh' => 4,
'Chattisgarh' => 22,
'Dadra and Nagar Haveli' => 26,
'Daman and Diu' => 25,
@aadilprabhakar
aadilprabhakar / indian-gst-state.js
Created January 2, 2018 11:45
GST Codes for each of the Indian States as object
this.StateVsGstIndex = [
{state: 'Andaman and Nicobar Islands', gstcode: 35 },
{state: 'Andhra Pradesh', gstcode: 37 },
{state: 'Arunachal Pradesh', gstcode: 12 },
{state: 'Assam', gstcode: 18 },
{state: 'Bihar', gstcode: 10 },
{state: 'Chandigarh', gstcode: 4 },
{state: 'Chattisgarh', gstcode: 22 },
{state: 'Dadra and Nagar Haveli', gstcode: 26 },
{state: 'Daman and Diu', gstcode: 25 },