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 / selectBox2ActiveItem.js
Last active April 17, 2019 23:18
Adding class to jQuery SelectBox selected dropdown option for styling purposes
// Improved code using selectBox callback fucntions.
$("select").selectbox({
onOpen: function(inst) {
var $this = $(this),
thisAnchor = $this.siblings('.sbHolder').find('.sbOptions').find('a[href="#' + $this.val() + '"]');
thisAnchor.closest('li').addClass('active').siblings('li').removeClass('active');
},
onClose: function(inst) {
@zeshanshani
zeshanshani / jquery-selectbox-styling.css
Last active August 18, 2019 09:18
SelectBox jQuery Plugin Styling
/* SelecBox Styling */
.sbHolder {
position: relative;
background: #fff;
cursor: default;
height: 48px;
float: left;
color: #9c9898;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
@zeshanshani
zeshanshani / changeNavbarColorOnScroll.js
Created February 16, 2015 11:46
Changing Navbar Background Color on Certain Scroll point
// Changing Navbar Background Color on Certain Scroll point
// By Zeshan Ahmed @zeshanshani
// After the addition, use class "alt-color" to style.
// .alt-color {
// background-color: #ff0000;
// }
jQuery(document).ready(function($) {
$(window).scroll(function() {
@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 / _helpfull-scss-mixins.scss
Last active December 27, 2021 15:13
SCSS mixins I use in my daily SCSS projects. Contains a wide range of helpful mixins for various things, e.g., generates font-size in 'rem' with 'px' fallback; generates small bootstrap similar grids for individual parts; etc. Include all or your desired ones from the list to your next project. Note: I use Bourbon.io to all of my projects, so ma…
// ===========================================
// sass/_mixins.scss
// ===========================================
//
// Custom SCSS Mixins.
//
// Variables used from _variables.scss file
// copy/change the variables to reflect the
// changes in your project.
// ===========================================
@zeshanshani
zeshanshani / missingAuthorUpdatedFix.css
Last active September 20, 2018 08:11
WordPress fix for "Missing Author" and "Missing Updated Date" Google structured data errors.
.hatom-extra {
font-style: italic;
margin-top: 10px;
padding-top: 10px;
font-size: 12px;
}
@zeshanshani
zeshanshani / pauseAllAudioPlayExceptOne.js
Last active October 23, 2015 20:17
Pause all audio players except the clicked one.
//
// Pause all audio players except the clicked one.
// Script by Zeshan Ahmed (http://www.zeshanahmed.com/)
//
jQuery(document).ready(function($) {
$('.mejs-playpause-button button').click(function() {
$('audio').not( $(this).closest('audio') ).each(function(){
this.pause();
this.currentTime = 0;
@zeshanshani
zeshanshani / sftp-config.json
Last active February 21, 2024 10:47
Default sftp-config.json settings for Sublime Text 3
{
// The tab key will cycle through the settings when first created
// Visit http://wbond.net/sublime_packages/sftp/settings for help
// sftp, ftp or ftps
"type": "ftp",
"save_before_upload": true,
"upload_on_save": true,
"sync_down_on_open": true,