Skip to content

Instantly share code, notes, and snippets.

View ahmadawais's full-sized avatar
Building the easiest way for developers to build AI products BaseAI.dev

Ahmad Awais ⌘ ahmadawais

Building the easiest way for developers to build AI products BaseAI.dev
View GitHub Profile
@ahmadawais
ahmadawais / 0_reuse_code.js
Created October 27, 2013 22:26
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@ahmadawais
ahmadawais / Humane.js-Notifications.markdown
Created December 4, 2013 08:26
A Pen by Ahmad Awais.
@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'
@ahmadawais
ahmadawais / aa_URLtoAttachmentID.php
Created August 16, 2014 12:06
Get the Attachment ID from an Image URL in WordPress
function pn_get_attachment_id_from_url( $attachment_url = '' ) {
global $wpdb;
$attachment_id = false;
// If there is no url, return.
if ( '' == $attachment_url )
return;
// Get the upload directory paths
<?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>