Skip to content

Instantly share code, notes, and snippets.

View zeshanshani's full-sized avatar
🎯
Focusing

Zeshan Ahmed zeshanshani

🎯
Focusing
View GitHub Profile
/*http://i-skool.co.uk/mobile-development/web-design-for-mobiles-and-tablets-viewport-sizes/*/
/*At least requires the meta viewport tag with content 'width=device-width'*/
@media only screen and (max-width: 1080px) and (orientation : portrait) {
/* PORTRAIT:
Windows Surface Pro*/
}
@media only screen and (max-width: 800px) and (orientation : portrait) {
/* PORTRAIT:
Acer Iconia Tab A100
@zeshanshani
zeshanshani / 0_reuse_code.js
Last active August 29, 2015 14:14
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
@zeshanshani
zeshanshani / input.scss
Last active August 29, 2015 14:15 — forked from twe4ked/input.scss
@mixin background-image-retina($file, $type, $width, $height) {
background-image: url($file + '.' + $type);
@media (-webkit-min-device-pixel-ratio: 2), (-moz-min-device-pixel-ratio: 2) {
& {
background-image: url($file + '@2x.' + $type);
-webkit-background-size: $width $height;
}
}
}
@zeshanshani
zeshanshani / gulpfile.js
Created October 28, 2015 01:18 — forked from ninjasort/gulpfile.js
Gulp Workflow - Sass, Uglify, Express, Copy, Bourbon, Neat, BrowserSync
var gulp = require('gulp'),
gutil = require('gulp-util'),
uglify = require('gulp-uglify'),
header = require('gulp-header'),
filter = require('gulp-filter'),
concat = require('gulp-concat'),
browserSync = require('browser-sync'),
sass = require('gulp-sass'),
bodyParser = require('body-parser'),
express = require('express'),
@zeshanshani
zeshanshani / acf-wrapper-functions.php
Created November 4, 2015 22:19 — forked from raideus/acf-wrapper-functions.php
Wrapper functions for Advanced Custom Fields
<?php
/**
* Return a custom field stored by the Advanced Custom Fields plugin
*
* @global $post
* @param str $key The key to look for
* @param mixed $id The post ID (int|str, defaults to $post->ID)
* @param mixed $default Value to return if get_field() returns nothing
* @return mixed
* @uses get_field()
@zeshanshani
zeshanshani / customizer-controls-40.php
Last active March 5, 2016 08:00 — forked from devinsays/customizer-controls-40
WordPress 4.0 Customizer Controls
<?php
function prefix_customizer_register( $wp_customize ) {
$wp_customize->add_panel( 'panel_id', array(
'priority' => 10,
'capability' => 'edit_theme_options',
'theme_supports' => '',
'title' => __( 'Example Panel', 'textdomain' ),
'description' => __( 'Description of what this panel does.', 'textdomain' ),
@zeshanshani
zeshanshani / gist:05dc77bf977a74dec9104fc72501b03d
Created May 17, 2016 07:29 — forked from betweenbrain/gist:5405671
Use cURL and SimpleXML to retrieve and parse Wordpress RSS feed
<?php
$curl = curl_init();
curl_setopt_array($curl, Array(
CURLOPT_URL => 'http://blogs.guggenheim.org/map/feed/',
CURLOPT_USERAGENT => 'spider',
CURLOPT_TIMEOUT => 120,
CURLOPT_CONNECTTIMEOUT => 30,
CURLOPT_RETURNTRANSFER => TRUE,
@zeshanshani
zeshanshani / nav-menu-exporter-importer.php
Created September 1, 2016 09:04 — forked from hissy/nav-menu-exporter-importer.php
[WordPress Plugin] Nav Menu Exporter and Importer / Export and Import nav menus. Requires WordPress Importer plugin.
<?php
/*
Plugin Name: Nav Menu Exporter and Importer
Description: Export and Import nav menus. Requires WordPress Importer plugin
Author: hissy, megumi themes
Version: 0.1
Text Domain: nav-menu-exporter-importer
License: GPL version 2 or later - http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
*/
@zeshanshani
zeshanshani / primary_category.php
Created September 19, 2017 09:46 — forked from jawinn/primary_category.php
Display Primary Category (Yoast's WordPress SEO)
<?php
// SHOW YOAST PRIMARY CATEGORY, OR FIRST CATEGORY
$category = get_the_category();
$useCatLink = true;
// If post has a category assigned.
if ($category){
$category_display = '';
$category_link = '';
if ( class_exists('WPSEO_Primary_Term') )