Skip to content

Instantly share code, notes, and snippets.

View bhaskarkc's full-sized avatar
🎯
Focusing

Bhaskar bhaskarkc

🎯
Focusing
View GitHub Profile
#!/bin/bash
################################################################################
# Ubuntu fonts installation helper for Fedora Linux
#
# This script is installing the fonts without any untrustworthy RPMs or build-
# hazzle. I think it is useful because there is only a "ubuntu-title-fonts"
# package included in the main repositories right now.
# Please note that the yum/RPM database is bypassed, so you can't uninstall
# the fonts by using yum erase/remove.
---------CRON JOB---------------------------------------------
#Bestee Import Products and Categories From Amazon every 5 Hours
00 */05 * * * curl -s -m 10 http://inheritx.dnsdynamic.com:8590/bestee/job/ImportAmazonProducts > /dev/null 2>&1
#Bestee Get The Score For Amazon Products After every 1 Hour
00 */01 * * * curl -s -m 10 http://inheritx.dnsdynamic.com:8590/bestee/job/TestFreakScoreMigration > /dev/null 2>&1
// Ensure cart contents update when products are added to the cart via AJAX (place the following in functions.php)
add_filter('add_to_cart_fragments', 'woocommerce_header_add_to_cart_fragment');
function woocommerce_header_add_to_cart_fragment( $fragments ) {
global $woocommerce;
ob_start();
?>
<a class="cart-contents" href="<?php echo $woocommerce->cart->get_cart_url(); ?>" title="<?php _e('View your shopping cart', 'woothemes'); ?>"><?php echo sprintf(_n('%d item', '%d items', $woocommerce->cart->cart_contents_count, 'woothemes'), $woocommerce->cart->cart_contents_count);?> - <?php echo $woocommerce->cart->get_cart_total(); ?></a>
#!/bin/bash
#
# SIV : System Information Viewer
#
# Author : Saikat Basak (saikat@saikatbasak.com)
#
# **** License ****
#
# The software is distributed under "THE BEER-WARE LICENSE" (Revision 42)
# The Beer-ware license was written by Poul-Henning Kamp. <phk@FreeBSD.ORG>
<?php # -*- coding: utf-8 -*-
/**
* Create a nav menu with very basic markup.
*
* @author Thomas Scholz http://toscho.de
* @version 1.0
*/
class T5_Nav_Menu_Walker_Simple extends Walker_Nav_Menu
{
/**
<?php
add_action('wp_ajax_twitter_share', 'twitter_share', 0);
add_action('wp_ajax_nopriv_twitter_share', 'twitter_share');
function twitter_share() {
$your_data = $_POST['your_data'];
echo $your_data;
die;
}
/**
* Programmatically logs a user in
*
* @param string $username
* @return bool True if the login was successful; false if it wasn't
*/
function programmatic_login( $username ) {
if ( is_user_logged_in() ) {
wp_logout();
@bhaskarkc
bhaskarkc / _.md
Last active August 29, 2015 14:18 — forked from vishalbasnet23/_.md

Since this is on Hacker News...

  • No, I don't distribute my résumé like this. A friend of mine made a joke about me being the kind of person who would do this, so I did (the link on that page was added later).
  • I apologize for the use of _t in my types. I spend a lot of time at a level where I can do that; "reserved for system libraries? I am the system libraries".
  • They're all while loops because shut up, you're overthinking a joke.
add_filter( 'woocommerce_checkout_fields' , 'custom_override_checkout_fields' );
function custom_override_checkout_fields( $fields ) {
$fields['billing']['billing_city']['label'] = 'City';
$fields['billing']['billing_phone']['required'] = false;
$fields['order']['order_comments']['placeholder'] = 'My new placeholder';
//removing fields
unset($fields['order']['order_comments']);
//adding custom fields
$fields['shipping']['shipping_phone'] = array(
'label' => __('Phone', 'woocommerce'),
<?php
/**
* This changes logging to only log fatal errors. This file should go in your mu-plugins directory.
*/
// Set the error logging to only log fatal errors
error_reporting( E_ERROR );
// Optional: change the location of your error log, it might be wise to put it outside your WP content dir.
// If you don't change it, the default place for this log is debug.log in your WP_CONTENT_DIR.