Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
Building AirGapped Crypto Vault

Ashish Kumar ashfame

💭
Building AirGapped Crypto Vault
View GitHub Profile
@ashfame
ashfame / deploy-all-lambdas.sh
Last active Feb 25, 2018
Bash script to deploy lambdas to all regions using Up - https://blog.ashfame.com/?p=1288
View deploy-all-lambdas.sh
#!/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 / nginx.conf
Last active Jan 9, 2018
HTTPS Cop recommended Nginx SSL config - https://httpscop.com
View nginx.conf
# 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 / index.php
Created Dec 12, 2011
SugarCRM REST API call examples
View index.php
<?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">
View embed-code.html
<!--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 / Best-way-to-wrap-up-your-jQuery-code-for-avoiding-conflicts.js
Created Feb 27, 2012
Best way to wrap up your jQuery code for avoiding conflicts
View Best-way-to-wrap-up-your-jQuery-code-for-avoiding-conflicts.js
(function($){
// Regular jQuery code inside
$(document).ready(function(){
});
})(jQuery);
@ashfame
ashfame / magento-set-defaults-address.php
Created Jun 13, 2013
Programmatically set default billing/shipping address of customers if they are not set in magento
View magento-set-defaults-address.php
<?php
require_once ("app/Mage.php");
umask(0);
Mage::app("default");
$collection = Mage::getModel('customer/customer')->getCollection()->addAttributeToSelect('*');
foreach ($collection as $customer) {
View fix-wordpress-permissions.sh
#!/bin/bash
#
# This script configures WordPress file permissions based on recommendations
# from http://codex.wordpress.org/Hardening_WordPress#File_permissions
#
# Author: Michael Conigliaro <mike [at] conigliaro [dot] org>
#
WP_OWNER=www-data # <-- wordpress owner
WP_GROUP=www-data # <-- wordpress group
WP_ROOT=$1 # <-- wordpress root directory
@ashfame
ashfame / config.xml
Created May 4, 2012
Overriding admin template in magento
View config.xml
<?xml version="1.0" encoding="UTF-8"?>
<config>
<modules>
<Anattadesign_Adminoverrider>
<version>1.0.0</version>
</Anattadesign_Adminoverrider>
</modules>
<global>
<layout>
<adminhtml_sales_order_create_index>
@ashfame
ashfame / delete-all-tags.php
Created Nov 25, 2011
Delete all tags of a WP install
View delete-all-tags.php
<?php
/**
* Delete all tags of a WordPress blog
*
* @author Ashfame
*
* Place this file in root of your WordPress install and open it in the browser - domain.com/delete-all-tags.php
*/
@ashfame
ashfame / after.php
Created Mar 17, 2014
Using WooCommerce email design in custom emails
View after.php
$email = 'ashfame@example.com';
$subject = 'Custom stuff email';
$email_heading = 'Custom Heading';
$email_content = ''; // whatever it is
ob_start();
do_action( 'woocommerce_email_header', $email_heading );
echo $email_content; // or simply have HTML markup outside PHP tags here
You can’t perform that action at this time.