Skip to content

Instantly share code, notes, and snippets.

View ahsanpervaiz's full-sized avatar

Muhammad Ahsan Pervaiz ahsanpervaiz

View GitHub Profile
@DESIGNfromWITHIN
DESIGNfromWITHIN / Gulpfile.js
Last active March 4, 2021 21:00
Gulpfile.js example Uses browser-sync, node-neat, gulp and gulp-sass
/*
Gulpfile.js file for the tutorial:
Using Gulp, SASS and Browser-Sync for your front end web development - DESIGNfromWITHIN
http://designfromwithin.com/blog/gulp-sass-browser-sync-front-end-dev
Steps:
1. Install gulp globally:
npm install --global gulp
@yorb
yorb / Pixel Measure.jsx
Last active December 14, 2018 16:31
Photoshop script for adding measurements to your mockups, based on Pixel Measure v0.04 by Nikolaj Selvik (https://code.google.com/p/pixelmeasure/)
/*
Photoshop script for adding measurements to your mockups,
based on Pixel Measure v0.04 by Nikolaj Selvik (https://code.google.com/p/pixelmeasure/)
To install: Place in /Applications/Adobe Photoshop CC/Presets/Scripts/ and restart Photoshop.
To use: Draw a rectangle marquee and invoke from File > Scripts > Pixel Measure.
Tips:
- Set your pencil to 1x1 and your foreground color to something visible (e.g., red).
- Set your Measurement Scale (Image > Analysis > Set Measurement Scale).
@boazsender
boazsender / mobilecheckbox.css
Created August 30, 2012 04:34
Mobile CSS checkboxes
input[type=checkbox] {
outline: none;
width: 58px;
height: 23px;
font-size: 11px;
line-height: 2;
display: block;
font-weight: bold;
border-radius: 3px;
border: 1px solid #B9B9B9;
(function($,sr){
// debouncing function from John Hann
// http://unscriptable.com/index.php/2009/03/20/debouncing-javascript-methods/
var debounce = function (func, threshold, execAsap) {
var timeout;
return function debounced () {
var obj = this, args = arguments;
function delayed () {
@wycks
wycks / htaccess cache and stuff
Last active March 26, 2022 20:48
Boilerplate .htaccess from Paul Irish with WordPress added
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
@boogah
boogah / .htaccess
Created February 16, 2012 04:59
Expire headers .htaccess code.
<IfModule mod_expires.c>
ExpiresActive on
# Perhaps better to whitelist expires rules? Perhaps.
ExpiresDefault "access plus 1 month"
# Data
ExpiresByType text/xml "access plus 0 seconds"
ExpiresByType application/xml "access plus 0 seconds"
ExpiresByType application/json "access plus 0 seconds"
@bohman
bohman / viewport.js
Last active November 20, 2020 11:37
jQuery get viewport size
// -----------
// Debugger that shows view port size. Helps when making responsive designs.
// -----------
function showViewPortSize(display) {
if(display) {
var height = jQuery(window).height();
var width = jQuery(window).width();
jQuery('body').prepend('<div id="viewportsize" style="z-index:9999;position:fixed;top:40px;left:5px;color:#fff;background:#000;padding:10px">Height: '+height+'<br>Width: '+width+'</div>');
jQuery(window).resize(function() {