Skip to content

Instantly share code, notes, and snippets.

Building AirGapped Crypto Vault

Ashish Kumar ashfame

Building AirGapped Crypto Vault
View GitHub Profile
View awesome-wp-config-file.php
* Define type of server
* Depending on the type other stuff can be configured
* Note: Define them all, don't skip one if other is already defined
define( 'DB_CREDENTIALS_PATH', dirname( ABSPATH ) ); // cache it for multiple use
ashfame / woocommerce-category-images-from-product.php
Last active Sep 10, 2020
Use WooCommerce product image as its category image, if category image is missing
View woocommerce-category-images-from-product.php
* Plugin Name: WooCommerce Category Images Modification
* Plugin URI:
* Description: Use product image as its category image on category archive pages (To override image for product category, upload one for that category and it will override)
* Author: Ashfame
* Version: 0.1.2
* Author URI:
ashfame / modify-page-title.php
Created Aug 3, 2012
Modifying page title using the_title filter in WordPress
View modify-page-title.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;
ashfame / nginx.conf
Created Jun 21, 2020
Shared nginx file for streaming to multiple platforms - untested, shared by a friend
View nginx.conf
#user nobody;
worker_processes 1;
error_log logs/error.log debug;
events {
worker_connections 1024;
http {
ashfame / Correct-way-to-enqueue-scripts-and-style-in-WordPress.php
Created Feb 27, 2012
Correct way to enqueue scripts and style in WordPress
View Correct-way-to-enqueue-scripts-and-style-in-WordPress.php
* Register Styles and Scripts
add_action( 'wp_enqueue_scripts', 'ft_scripts_styles' );
function ft_scripts_styles() {
ashfame / snippet.php
Created Mar 19, 2014
Querying post relationships in reverse direction when using Advanced Custom Fields plugin on WordPress
View snippet.php
$tour_pages = get_posts(
'post_type' => 'tour',
'meta_query' => array(
'key' => 'tour_author_relationship', // name of custom field
'value' => '"' . get_the_ID() . '"',
'compare' => 'LIKE'
ashfame / local-config-awesome-wp-config-file.php
Created Feb 27, 2012
Local config file to hold db credentials and for defining keys & salts along with the use of awesome wp-config.php file
View local-config-awesome-wp-config-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 -
/* WordPress Local Environment DB credentials */
ashfame / Recharge_Compliant_CSV_From_SubscribePro_Export.php
Created Jul 12, 2018
Feed the export from SubscribePro to it and it will generate a CSV that's Recharge compliant
View Recharge_Compliant_CSV_From_SubscribePro_Export.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 / paceOptions.js
Created Mar 9, 2018
Making Pace show for all ajax requests
View paceOptions.js
// 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 /
Created Nov 5, 2011
Shutdown linux (Ubuntu) when Dropbox completes transfer
# By Ashfame
while true
# keep checking for idle dropbox status
STATUS=`dropbox status`
if [ $STATUS = 'Idle' ]; then
notify-send "System Shutdown" "System will power off now"