Skip to content

Instantly share code, notes, and snippets.

View mazhar266's full-sized avatar
💭
I may be slow to respond.

Mazhar Ahmed mazhar266

💭
I may be slow to respond.
View GitHub Profile
@mazhar266
mazhar266 / reset-this.css
Created March 20, 2014 14:01
Reset CSS Style of an Element
.reset-this {
animation : none;
animation-delay : 0;
animation-direction : normal;
animation-duration : 0;
animation-fill-mode : none;
animation-iteration-count : 1;
animation-name : none;
animation-play-state : running;
animation-timing-function : ease;
@mazhar266
mazhar266 / select-protected.css
Created March 5, 2014 19:47
Prohibit text selection using CSS
.protected {
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-o-user-select: none;
user-select: none;
pointer: default;
cursor: default;
}
@mazhar266
mazhar266 / bootstrap.css
Last active August 1, 2017 11:42
Media Query as Bootstrap
@media(max-width:767px){}
@media(min-width:768px){}
@media(min-width:992px){}
@media(min-width:1200px){}
@mazhar266
mazhar266 / smooth-font.css
Created August 30, 2013 10:59
font smoothing in CSS3
body {
-webkit-font-smoothing: subpixel-antialiased;
-moz-osx-font-smoothing: grayscale;
-webkit-text-stroke: .2px;
}
.anim {
-webkit-transform: translate3d(0,0,0);
-moz-transform: translate3d(0,0,0);
-ms-transform: translate3d(0,0,0);
-o-transform: translate3d(0,0,0);
transform: translate3d(0,0,0);
}
@mazhar266
mazhar266 / cURL.sh
Created April 13, 2013 06:04
Command line cURL for posting data
# for posting data only
curl --data "param1=value1&param2=value2" http://example.com/resource.cgi
# for posting files
curl --form "[email protected]" http://example.com/resource.cgi
@mazhar266
mazhar266 / pagination.css
Created February 20, 2013 13:29
Bootstrap pagination center align.css
.pagination {
word-spacing: -1em !important;
text-align:center !important;
}
.pagination li {
display: -moz-inline-box !important;
display: inline-block !important;
word-spacing: normal !important;
vertical-align: top !important;
margin-left:0px !important;
@mazhar266
mazhar266 / ajax.php
Created May 7, 2012 13:05
detect ajax call
<?php
/* decide what the content should be up here .... */
$content = get_content(); //generic function;
/* AJAX check */
if(!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') {
/* special ajax here */
die($content);
}
@mazhar266
mazhar266 / generateSlug.php
Created April 21, 2012 09:18
SEO style URL making (removing unsupported)
<?php
function generateSlug($phrase, $maxLength)
{
$result = strtolower($phrase);
$result = preg_replace("/[^a-z0-9\s-]/", "", $result);
$result = trim(preg_replace("/[\s-]+/", " ", $result));
$result = trim(substr($result, 0, $maxLength));
$result = preg_replace("/\s/", "-", $result);
@mazhar266
mazhar266 / execute.php
Created April 12, 2012 10:23
time to execute
<?php
//Create a variable for start time
$time_start = microtime(true);
// Place your PHP/HTML/JavaScript/CSS/Etc. Here
//Create a variable for end time
$time_end = microtime(true);
//Subtract the two times to get seconds
$time = $time_end - $time_start;