Skip to content

Instantly share code, notes, and snippets.

Raja rajakannan

Block or report user

Report or block rajakannan

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@rajakannan
rajakannan / 0_reuse_code.js
Created Jun 6, 2014
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@rajakannan
rajakannan / Streetview_with_road_map_binded.html
Last active Aug 29, 2015
Displaying a road map on top of the street view and binding them
View Streetview_with_road_map_binded.html
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<title>Google Maps JavaScript API Example: Street View with Map</title>
<link href="http://code.google.com/apis/maps/documentation/javascript/examples/standard.css" rel="stylesheet" type="text/css" />
<script src="http://maps.google.com/maps/api/js?sensor=false" type="text/javascript"></script>
<script type="text/javascript">
function initialize() {
@rajakannan
rajakannan / wc-product-meta-display.php
Created Mar 1, 2015
Here is a quick snippet to display WooCommerce product custom meta fields values (place it in functions.php):
View wc-product-meta-display.php
<?php
/**
* WooCommerce Extra Feature
* --------------------------
*
* Display product meta field in a shortcode
* ex: [woo_custom_field id="my-custom-field"]
*
*/
function woo_custom_field_shortcode( $atts, $content = null ) {
View Woocommerce-product-meta.php
<?php
// Display Fields
add_action( 'woocommerce_product_options_general_product_data', 'woo_add_custom_general_fields' );
// Save Fields
add_action( 'woocommerce_process_product_meta', 'woo_add_custom_general_fields_save' );
function woo_add_custom_general_fields() {
@rajakannan
rajakannan / gformscopyaddress.js
Created Jan 7, 2016 — forked from tnorthcutt/gformscopyaddress.js
Autofill a set of fields (in a gravity form, in this case) based on a checkbox being checked.
View gformscopyaddress.js
jQuery(document).ready(function($) {
$('input#choice_13_1').click(function() {
if($(this).is(':checked')) {
$('#input_2_12_1').val($('#input_2_2_1').val());
$('#input_2_12_2').val($('#input_2_2_2').val());
$('#input_2_12_3').val($('#input_2_2_3').val());
$('#input_2_12_4').val($('#input_2_2_4').val());
$('#input_2_12_5').val($('#input_2_2_5').val());
};
});
@rajakannan
rajakannan / linux-apache-file-dir-permission.sh
Created Oct 31, 2016
Linux apache file and directory permission
View linux-apache-file-dir-permission.sh
groups
sudo groupadd www
sudo usermod -a -G www ec2-user
sudo usermod -a -G www apache
sudo chown -R root:www castle_invoice/
find ./castle_invoice -type d -exec sudo chmod 2775 {} \;
find ./castle_invoice -type f -exec sudo chmod 0664 {} \;
sudo service httpd restart
@rajakannan
rajakannan / woocommerce-failed-order-email-notification.php
Created Mar 14, 2016
WooCommerce failed order email notification
View woocommerce-failed-order-email-notification.php
<?php
/**
* Add a failed order email notification
*/
function sp_failed_order_email_notification( $order_id ) {
$order = wc_get_order( $order_id );
$to = get_option( 'admin_email' );
$subject = 'A order failed, action required';
View nexmo_call_test.json
[
{
"action": "talk",
"voiceName": "Russell",
"text": "Hi Darling.Learn javascript as soon as possible.Love you. Bye"
}
]
View advanced-js-resources.md

Advanced JavaScript Learning Resources

This is a list of advanced JavaScript learning resources from people who responded to this [Tweet][13] and this [Tweet][20].

  • [You Don't Know JS][3]

  • [Frontend Masters courses by Kyle Simpson][12]

  • [@mpjme][6]'s [YouTube videos][5]

@rajakannan
rajakannan / WordPress-Utility.php
Created Jul 12, 2019
Most used wordpress custom codes
View WordPress-Utility.php
<?php
//////////////////////
// Custom Post Type //
//////////////////////
/*
* Creating a function to create our CPT tours
*/
You can’t perform that action at this time.