Skip to content

Instantly share code, notes, and snippets.

View psahalot's full-sized avatar

Puneet Sahalot psahalot

View GitHub Profile
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
sudo /etc/init.d/apache2 restart
<?php
/*
Name: Thesis BizLife
Author: Puneet Sahalot
Version: 1.0
Description: Build your portfolio or business site quickly with a few clicks. It's all possible with the new beast, Thesis 2.0
Class: thesis_bizlife
*/
@psahalot
psahalot / BizLife call to action
Created October 11, 2012 10:22
Call to action button for BizLife
<a href="http://icustomizethesis.com/contact/" class="action-button">Hire Me</a>
@psahalot
psahalot / Read more button
Created October 11, 2012 10:24
Read more button for BizLife Skin
<a href="your-url" class="rm-button">Read More</a>
@psahalot
psahalot / CenterCenter align read more button
Created October 11, 2012 10:25
Center align read more button BizLife Skin
<p style="text-align:center;"><a href="your-url" class="rm-button">Read More</a></p>
@psahalot
psahalot / Drupal to WP
Created October 16, 2012 19:13
SQL queries for importing Drupal 6.x content to WordPress
# DRUPAL-TO-WORDPRESS CONVERSION SCRIPT
# Changelog
# 07.29.2010 - Updated by Scott Anderson / Room 34 Creative Services http://blog.room34.com/archives/4530
# 02.06.2009 - Updated by Mike Smullin http://www.mikesmullin.com/development/migrate-convert-import-drupal-5-to-wordpress-27/
# 05.15.2007 - Updated by D’Arcy Norman http://www.darcynorman.net/2007/05/15/how-to-migrate-from-drupal-5-to-wordpress-2/
# 05.19.2006 - Created by Dave Dash http://spindrop.us/2006/05/19/migrating-from-drupal-47-to-wordpress/
# This assumes that WordPress and Drupal are in separate databases, named 'wordpress' and 'drupal'.
@psahalot
psahalot / Amazon EC2 + WP
Created October 20, 2012 05:50
Installing and running WordPress on Amazon EC2
// switch to root user
sudo su
// install Apache
apt-get install apache2
// install PHP and related modules
apt-get install php5
apt-get install libapache2-mod-php5
@psahalot
psahalot / skip-to-check-out.php
Created October 20, 2015 21:12 — forked from micc83/skip-to-check-out.php
Skip cart and redirect to direct checkout on WooCommerce
<?php
/**
* Skip cart and redirect to direct checkout
*
* @package WooCommerce
* @version 1.0.0
* @author Alessandro Benoit
*/
// Skip the cart and redirect to check out url when clicking on Add to cart
@psahalot
psahalot / gist:2e2df59635ed2bdc5a08
Created December 2, 2015 16:39
Empty WooCommerce cart before adding new product
add_filter( 'woocommerce_add_cart_item_data', 'ps_empty_cart', 10, 3);
function ps_empty_cart( $cart_item_data, $product_id, $variation_id ) {
global $woocommerce;
$woocommerce->cart->empty_cart();
// Do nothing with the data and return
return $cart_item_data;
}