Skip to content

Instantly share code, notes, and snippets.

View ashfame's full-sized avatar
💭
What parts of our society are best governed by code?

Ashish Kumar ashfame

💭
What parts of our society are best governed by code?
View GitHub Profile
<!--Begin CTCT Sign-Up Form-->
<!-- EFD 1.0.0 [Mon Aug 28 11:09:22 EDT 2017] -->
<div class="ctct-embed-signup">
<div>
<span id="success_message" style="display:none;">
<div style="text-align:center;">
<h3 class="article--title">
Thank you for taking the next step in healing your arthritis. You should receive your video in your email shortly.
</h3>
@ashfame
ashfame / index.php
Created December 12, 2011 15:44
SugarCRM REST API call examples
<?php
/**
* SugarCRM RESTS API Call examples
*
* REST API Wrapper - https://github.com/asakusuma/SugarCRM-REST-API-Wrapper-Class
*/
?>
<!doctype html>
<head>
<meta charset="utf-8">
@ashfame
ashfame / nginx.conf
Last active January 9, 2018 21:01
HTTPS Cop recommended Nginx SSL config - https://httpscop.com
# To be safe, make a backup of your existing ssl config file, before making any changes in it
# Test your SSL config by "nginx -t". You might need to use "sudo nginx -t".
# Once config is validated to be good, reload nginx by "sudo service nginx reload".
# Following config file was tested on nginx/1.10.3
server {
listen 443 ssl;
server_name yoursite.com;
@ashfame
ashfame / deploy-all-lambdas.sh
Last active February 25, 2018 18:27
Bash script to deploy lambdas to all regions using Up - https://blog.ashfame.com/?p=1288
#!/usr/bin/env bash
declare -a regions=(
us-east-2 #US East (Ohio)
us-east-1 #US East (N. Virginia)
us-west-1 #US West (N. California)
us-west-2 #US West (Oregon)
ap-northeast-1 #Asia Pacific (Tokyo)
ap-northeast-2 #Asia Pacific (Seoul)
ap-south-1 #Asia Pacific (Mumbai)
@ashfame
ashfame / shutdown-dropbox-done.sh
Created November 5, 2011 23:41
Shutdown linux (Ubuntu) when Dropbox completes transfer
#!/bin/bash
# By Ashfame
while true
do
# keep checking for idle dropbox status
STATUS=`dropbox status`
if [ $STATUS = 'Idle' ]; then
notify-send "System Shutdown" "System will power off now"
@ashfame
ashfame / paceOptions.js
Created March 9, 2018 05:50
Making Pace show for all ajax requests
// define options for Pace - ajax progress showing library
paceOptions = {
restartOnRequestAfter: 50, // make it work for short AJAX requests only (ajax requests taking longer than 50ms will trigger it)
ajax: {
trackMethods: [ 'GET', 'POST', 'DELETE', 'PUT', 'PATCH' ]
}
};
@ashfame
ashfame / Recharge_Compliant_CSV_From_SubscribePro_Export.php
Created July 12, 2018 20:16
Feed the export from SubscribePro to it and it will generate a CSV that's Recharge compliant
<?php
// For reuse, just look inside get_mapped_value() that's where all the specific data handling is, which is what you will need to change
// To understand, how this works, head to run()
// ini_set( 'memory_limit', '2000M' );
class Recharge_Compliant_CSV_From_SubscribePro_Export {
private $source_csv_filename;
@ashfame
ashfame / local-config-awesome-wp-config-file.php
Created February 27, 2012 13:34
Local config file to hold db credentials and for defining keys & salts along with the use of awesome wp-config.php file
<?php
/**
* WordPress config file to use one directory above WordPress root, when awesome version of wp-config.php is in use.
*
* Awesome wp-config.php file - https://gist.github.com/1923821
*/
/* WordPress Local Environment DB credentials */
@ashfame
ashfame / nginx.conf
Created June 21, 2020 08:41
Shared nginx file for streaming to multiple platforms - untested, shared by a friend
#user nobody;
worker_processes 1;
error_log logs/error.log debug;
events {
worker_connections 1024;
}
http {
@ashfame
ashfame / modify-page-title.php
Created August 3, 2012 15:43
Modifying page title using the_title filter in WordPress
<?php
add_filter( 'the_title', 'nine11day_modify_post_title' );
function nine11day_modify_post_title( $title ) {
if ( is_page() && in_the_loop() && $title == 'Existing Title' )
$title = '<span>Existing</span> Title';
return $title;
}