Skip to content

Instantly share code, notes, and snippets.

🎯
JavaScript, Angular & ASP.NET

Aamer Shahzad talentedaamer

🎯
JavaScript, Angular & ASP.NET
  • Pakistan / Islamabad
Block or report user

Report or block talentedaamer

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
@talentedaamer
talentedaamer / component-file.js
Last active Feb 3, 2019
Usage of strUcWords function.
View component-file.js
/**
* import helper functions
*/
import { strUcWords } from './helper-functions';
let str = strUcWords( 'hello world in lowercase' );
// output : 'Hello World In Lowercase'
@talentedaamer
talentedaamer / helper-functions.js
Last active Feb 3, 2019
ucWords in JavaScript.
View helper-functions.js
/**
* uppercase words in string.
*
* @param str
* @returns {string}
*/
export function strUcWords ( str ) {
return ( str + '' ).replace(/\b[a-z]/g, function (letter) {
return letter.toUpperCase()
})
@talentedaamer
talentedaamer / plugin_or_theme_functions.php
Last active Sep 3, 2018
add custom column content to taxonomy (carousel_category) list table page.
View plugin_or_theme_functions.php
<?php
/*
* filter pattern: manage_{taxonomy}_custom_column
* where {taxonomy} is the name of taxonomy e.g; 'carousel_category'
* codex ref: https://codex.wordpress.org/Plugin_API/Filter_Reference/manage_$taxonomy_id_columns
*/
add_filter( 'manage_carousel_category_custom_column', 'wptc_carousel_category_column_content', 10, 3 );
function wptc_carousel_category_column_content( $content, $column_name, $term_id ) {
// get the term object
$term = get_term( $term_id, 'carousel_category' );
@talentedaamer
talentedaamer / plugin_or_theme_functions.php
Last active Sep 3, 2018
add custom column to taxonomy (carousel_category) list table page.
View plugin_or_theme_functions.php
<?php
/*
* filter pattern: manage_edit-{taxonomy}_columns
* where {taxonomy} is the name of taxonomy e.g; 'carousel_category'
* codex ref: https://codex.wordpress.org/Plugin_API/Filter_Reference/manage_$taxonomy_id_columns
*/
add_filter( 'manage_edit-carousel_category_columns' , 'wptc_carousel_category_columns' );
function wptc_carousel_category_columns( $columns ) {
// remove slug column
unset($columns['slug']);
@talentedaamer
talentedaamer / custom_cron_scedule_intervals.php
Last active Jul 31, 2018
add custom weekly, monthly and 30 minutes cron time schedules via cron_schedules filter hook
View custom_cron_scedule_intervals.php
<?php
function wptc_add_intervals( $schedules ) {
// add a 'weekly' interval
if( ! isset( $schedules['weekly'] ) ) {
$schedules['weekly'] = array(
'interval' => 604800, // seconds in a week
'display' => __('Once Weekly')
);
}
// add a 'monthly' interval
@talentedaamer
talentedaamer / custom_cron_scedule_time.php
Last active Jul 31, 2018
Create new schedule times via 'cron_schedules' filter hook
View custom_cron_scedule_time.php
<?php
// using 30min time interval
wp_schedule_event( time(), '30min', 'wptc_custom_schedule_hook', $args );
// using weekly time interval
wp_schedule_event( time(), 'weekly', 'wptc_custom_schedule_hook', $args );
// using monthly time interval
wp_schedule_event( time(), 'montly', 'wptc_custom_schedule_hook', $args );
@talentedaamer
talentedaamer / brain-coordinates
Last active Apr 24, 2018
brain graph co ordinates
View brain-coordinates
x,y,z,i,o,name,color
-38.65,-5.68,50.94,0,1,Precentral-L,red
41.37,-8.21,52.09,0,1,Precentral-R,red
-18.45,34.81,42.2,0,1,Frontal-Sup-L,blue
21.9,31.12,43.82,0,1,Frontal-Sup-R,blue
-16.56,47.32,-13.31,0,1,Frontal-Sup-Orb-L,orange
18.49,48.1,-14.02,0,1,Frontal-Sup-Orb-R,orange
-33.43,32.73,35.46,0,1,Frontal-Mid-L,green
37.59,33.06,34.04,0,1,Frontal-Mid-R,green
-30.65,50.43,-9.62,0,1,Frontal-Mid-Orb-L,blue
View gist:3e1764320a2f0e3f9814
<div id="wrapper" class="properties-filter">
<div class="container">
<h1 class="section-heading text-center upper color-blue mb-30 font-48">Available Properties</h1>
<nav class="primary clearfix">
<ul class="properties-filter-menu list-inline mb-30">
<?php
$args = array(
'orderby' => 'name',
'order' => 'ASC',
@talentedaamer
talentedaamer / gist:8813f7031877be14836e
Last active Nov 26, 2015
enqueue isotope js and custom js functions file.
View gist:8813f7031877be14836e
<?php
/**
* Theme Directories & Paths
* ===================================
*/
if (!defined('FRAMEWORK_DIR'))
define('FRAMEWORK_DIR', trailingslashit(get_template_directory()));
if (!defined('FRAMEWORK_URI'))
define('FRAMEWORK_URI', trailingslashit(get_template_directory_uri()));
@talentedaamer
talentedaamer / gist:d35469ba928224c72207
Created Nov 26, 2015
custom functions to call JavaScript and jQuery functions and plugins.
View gist:d35469ba928224c72207
/**
* custom js functions
*/
jQuery(function ($) {
// filterable properties.
var $container = $('.properties');
$container.isotope({
filter: '*',
animationOptions: {
You can’t perform that action at this time.