Skip to content

Instantly share code, notes, and snippets.

View ahmadawais's full-sized avatar
Building the LLM computing primitive at Langbase.com

Ahmad Awais ⌘ ahmadawais

Building the LLM computing primitive at Langbase.com
View GitHub Profile
@ahmadawais
ahmadawais / BirdMan
Created February 14, 2014 07:17 — forked from anonymous/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;
@ahmadawais
ahmadawais / Gemfile
Created August 16, 2014 08:32 — forked from tbbooher/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'
<?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 August 22, 2014 08:21
Quickstand Filterable Portfolio script for latest jQuery shipped with WordPress
/*-----------------------------------------------------------------------------------
Custom JS - All front-end jQuery
-----------------------------------------------------------------------------------*/
jQuery.noConflict();
jQuery(document).ready(function() {
@ahmadawais
ahmadawais / aa_custom_page.php
Created August 24, 2014 09:32
Fetch Number of posts in Last 24 hours for WordPress
<?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(); ?>
<?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>
@ahmadawais
ahmadawais / gist:0ddde36a2bb8c83bd52b
Created October 6, 2014 01:42
Check if it is a particular WordPress page
/**
* @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 October 19, 2014 10:06
Echo and Decode HTML in a Meta value of WordPress
<?php
/*
* Normally
* $content=get_post_meta($post->ID, 'SMTH_METANAME_VALUE', true);
* echo $content
**/
echo html_entity_decode($content);
// 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'] );