Skip to content

Instantly share code, notes, and snippets.

View ravinsharma12345's full-sized avatar

Ravin ravinsharma12345

View GitHub Profile
<?php
/**
* @package Redirect to homepage after logout
* @version 0.1
*/
/*
Plugin Name: Redirect to homepage after logout
Plugin URI: http://daankortenbach.nl/wordpress/redirect-to-homepage-after-logout/
Description: Redirects the user to the homepage after logout
Author: Daan Kortenbach
/**
* Determine if a post exists based on post_name and post_type
*
* @param $post_name string unique post name
* @param $post_type string post type (defaults to 'post')
*/
function post_exists( $post_name, $post_type='post' ) {
global $wpdb;
<?php
<form name="post" action="post.php" method="post" id="post"<?php do_action('post_edit_form_tag');
<?php
/**
* Callback for WordPress 'post_edit_form_tag' action.
*
* Append enctype - multipart/form-data and encoding - multipart/form-data
* to allow image uploads for post type 'post'
*
* @global type $post
* @return type
//Display Fields
add_action( 'woocommerce_product_after_variable_attributes', 'variable_fields', 10, 2 );
//JS to add fields for new variations
add_action( 'woocommerce_product_after_variable_attributes_js', 'variable_fields_js' );
//Save variation fields
add_action( 'woocommerce_process_product_meta_variable', 'variable_fields_process', 10, 1 );
function variable_fields( $loop, $variation_data ) {
?>
<tr>
vagrant box add raring-32 http://cloud-images.ubuntu.com/vagrant/raring/current/raring-server-cloudimg-i386-vagrant-disk1.box
vagrant init raring-32
vagrant up
vagrant ssh
#sudo aptitude install php5-cli php5-dev php-pear imagemagick libmagickwand-dev libmagickcore-dev php5-imagick
#sudo pecl install imagick-beta

Multiple PHP version under Ubuntu 13.04

Update your machine

apt-get update
apt-get ugrade

Install some dependencies

apt-get install build-essential

request = require 'request'
Restzilla = require 'restzilla'
BUGZILLA_URL = 'https://www.w3.org/Bugs/Public/'
BURL = 'http://localhost:8000/AudioWG/MIDI%20API/'
GH_USER = 'jussi-kalliokoski'
GH_REPO = 'webmidi-issues'
GH_URL = 'https://api.github.com/repos/' + GH_USER + '/' + GH_REPO + '/issues'
GH_AUTH =
username: 'octocat'
ctrl-z
bg
touch /tmp/stdout
touch /tmp/stderr
gdb -p $!
# In GDB
p dup2(open("/tmp/stdout", 1), 1)
p dup2(open("/tmp/stderr", 1), 2)