Skip to content

Instantly share code, notes, and snippets.

View amitasthana's full-sized avatar

Amit Asthana amitasthana

  • India
View GitHub Profile
@mikejolley
mikejolley / gist:1604009
Created January 13, 2012 00:31
WooCommerce - Add a special field to the checkout, order emails and user/order meta
/**
* Add the field to the checkout
**/
add_action('woocommerce_after_order_notes', 'my_custom_checkout_field');
function my_custom_checkout_field( $checkout ) {
echo '<div id="my_custom_checkout_field"><h3>'.__('My Field').'</h3>';
/**
@jellybeansoup
jellybeansoup / cltools.sh
Last active March 7, 2024 22:57
Install Autoconf and Automake on OS X Mountain Lion
#!/bin/sh
##
# Install autoconf, automake and libtool smoothly on Mac OS X.
# Newer versions of these libraries are available and may work better on OS X
#
# This script is originally from http://jsdelfino.blogspot.com.au/2012/08/autoconf-and-automake-on-mac-os-x.html
#
export build=~/devtools # or wherever you'd like to build
@serdarb
serdarb / Download and Install MongoDB as Windows Service PowerShell Script
Last active July 26, 2023 12:22
A nice powershell that dowloads mongodb and installs it as windows service... this script is good for development machines.
Set-ExecutionPolicy RemoteSigned
$mongoDbPath = "C:\MongoDB"
$mongoDbConfigPath = "$mongoDbPath\mongod.cfg"
$url = "http://downloads.mongodb.org/win32/mongodb-win32-x86_64-2008plus-2.4.9.zip"
$zipFile = "$mongoDbPath\mongo.zip"
$unzippedFolderContent ="$mongoDbPath\mongodb-win32-x86_64-2008plus-2.4.9"
if ((Test-Path -path $mongoDbPath) -eq $True)
{
test.os.lower() = linux test.database_os.lower() = linux
self.results['frameworks'] != None: True
test.name: hapi-mysql
self.results['completed']: {}
=====================================================
Beginning hapi-mysql
-----------------------------------------------------
-----------------------------------------------------
@francoisTemasys
francoisTemasys / bongo.sh
Last active November 5, 2018 12:12 — forked from smashew/bongo.sh
LOADING=false
usage()
{
cat << EOF
usage: $0 [options] <DBNAME>
OPTIONS:
-h Show this help.
-l Load instead of export
#
# @author Jonathon byrd
#
############################################################
# first things first, set your iptables for a web server. If you jack these
# up you don't want to have to re-install your os after doing much more.
# @see http://www.thegeekstuff.com/2011/06/iptables-rules-examples/
# and
# @see https://help.ubuntu.com/community/IptablesHowTo
@pblca
pblca / instantiate.html
Last active June 18, 2017 05:36
Getting Started Tutorial for Using PubNub with JavaScript
<!-- Include the PubNub Library -->
<script src="https://cdn.pubnub.com/pubnub.min.js"></script>
<!-- Instantiate PubNub -->
<script type="text/javascript">
var PUBNUB_demo = PUBNUB.init({
publish_key: 'Your Publish Key Here',
subscribe_key: 'Your Subscribe Key Here'
});
@bentasm1
bentasm1 / functions.php
Last active June 8, 2017 01:04
Add custom fields to shop settings
add_action('wcvendors_settings_after_paypal', 'pv_add_custom_merchant_id_field');
function pv_add_custom_merchant_id_field() {
?>
<div class="pv_merchant_id_container">
<p><b><?php _e( 'Merchant ID', 'wc_product_vendor' ); ?></b><br/>
<?php _e( 'Your Checkout.fi merchant ID.', 'wc_product_vendor' ); ?><br/>
<input type="text" name="pv_merchant_id" id="pv_merchant_id" placeholder="1234" value="<?php echo get_user_meta( get_current_user_id(), 'pv_merchant_id', true ); ?>" />
</p>
</div>
@simonswine
simonswine / copy-k8s-resources-across-namespaces.sh
Created August 2, 2016 13:40
Copying kubernetes resources accross namespaces
kubectl get rs,secrets -o json --namespace old | jq '.items[].metadata.namespace = "new"' | kubectl create-f -
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: mongodb
spec:
template:
metadata:
labels:
app: mongodb
spec: