Skip to content

Instantly share code, notes, and snippets.

Avatar
📟
Recording videos for NodeCLI.com

Ahmad Awais ⚡️ ahmadawais

📟
Recording videos for NodeCLI.com
View GitHub Profile
View BirdMan
package crappyBird;
import java.awt.Graphics;
import java.awt.Rectangle;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.image.BufferedImage;
import java.io.IOException;
import java.net.URL;
View Gemfile
source "http://rubygems.org"
group :development do
gem 'rake'
gem 'guard'
gem 'coffee-script'
gem 'rb-fsevent'
gem 'rb-inotify'
gem 'compass', '0.11.5'
gem 'sass', '3.1.5'
gem 'guard-compass'
View commercial-client.php
<?php
/*
* Plugin Name: Commercial Client
* Plugin URI: http://pento.net/
* Description: A sample client plugin for showing updates for non-WordPress.org plugins
* Author: pento
* Version: 0.1
* Author URI: http://pento.net/
* License: GPL2+
*/
@ahmadawais
ahmadawais / script.js
Created Aug 22, 2014
Quickstand Filterable Portfolio script for latest jQuery shipped with WordPress
View script.js
/*-----------------------------------------------------------------------------------
Custom JS - All front-end jQuery
-----------------------------------------------------------------------------------*/
jQuery.noConflict();
jQuery(document).ready(function() {
@ahmadawais
ahmadawais / aa_custom_page.php
Created Aug 24, 2014
Fetch Number of posts in Last 24 hours for WordPress
View aa_custom_page.php
<?php /* Template Name: Test AA */
get_header(); ?>
<!-- section -->
<section class="aa_sec1">
<?php echo aa_get_posts_count_from_last_24h(); ?>
<?php echo aa_get_posts_count_from_today(); ?>
View image-upload-field-custom-taxonomy
<?php
/* Add Image Upload to Series Taxonomy */
// Add Upload fields to "Add New Taxonomy" form
function add_series_image_field() {
// this will add the custom meta field to the add new term page
?>
<div class="form-field">
<label for="series_image"><?php _e( 'Series Image:', 'journey' ); ?></label>
View Background-image-gradient-overlay.markdown
@ahmadawais
ahmadawais / gist:0ddde36a2bb8c83bd52b
Created Oct 6, 2014
Check if it is a particular WordPress page
View gist:0ddde36a2bb8c83bd52b
/**
* @Check if it is a particular WordPress page
* @Codex http://codex.wordpress.org/Function_Reference/is_page
*
*/
if(is_page(42)){
//This runs when page with ID 42 is being displayed
}
else{
@ahmadawais
ahmadawais / meta.php
Created Oct 19, 2014
Echo and Decode HTML in a Meta value of WordPress
View meta.php
<?php
/*
* Normally
* $content=get_post_meta($post->ID, 'SMTH_METANAME_VALUE', true);
* echo $content
**/
echo html_entity_decode($content);
View WordPress: Minimize Dashboard
// Custom Dashboard widgets
function custom_dashboard_widgets() {
global $wp_meta_boxes;
unset( $wp_meta_boxes['dashboard']['side']['core']['dashboard_quick_press'] );
unset( $wp_meta_boxes['dashboard']['normal']['core']['dashboard_incoming_links'] );
unset( $wp_meta_boxes['dashboard']['normal']['core']['dashboard_plugins'] );
unset( $wp_meta_boxes['dashboard']['side']['core']['dashboard_primary'] );
unset( $wp_meta_boxes['dashboard']['normal']['core']['dashboard_right_now'] );
unset( $wp_meta_boxes['dashboard']['normal']['core']['dashboard_recent_comments'] );
You can’t perform that action at this time.