Skip to content

Instantly share code, notes, and snippets.

View fazlurr's full-sized avatar

Fazlur Rahman fazlurr

View GitHub Profile
@fazlurr
fazlurr / dabblet.css
Created June 22, 2014 14:37 — forked from LeaVerou/dabblet.css
Flexbox playground
/**
* Flexbox playground
*/
body {
margin: 0;
display: flex;
flex-flow: row;
flex-wrap: wrap;
align-content: stretch;
@fazlurr
fazlurr / dabblet.css
Created June 22, 2014 14:35 — forked from LeaVerou/dabblet.css
Gradient cheatsheet
/* Gradient cheatsheet */
background: linear-gradient(45deg, white, black);
background: linear-gradient(to right, white 50%, red, black);
background: linear-gradient(to bottom right, white 50px, black);
background: repeating-linear-gradient(to bottom left, white, black 30px);
background: radial-gradient(at top right, white, black);
background: radial-gradient(circle at top right, lime 50%, black 0);
background: radial-gradient(farthest-corner at center, red 80%, black);
background: radial-gradient(farthest-side at center, yellow 80%, black);
@fazlurr
fazlurr / dabblet.css
Created June 22, 2014 14:33 — forked from LeaVerou/dabblet.css
Beveled corners & negative border-radius with CSS gradients
/**
* Beveled corners & negative border-radius with CSS gradients
*/
div {
background: #c00; /* fallback */
background:
linear-gradient(135deg, transparent 10px, #c00 0) top left,
linear-gradient(225deg, transparent 10px, #c00 0) top right,
linear-gradient(315deg, transparent 10px, #c00 0) bottom right,
@fazlurr
fazlurr / dabblet.css
Created June 22, 2014 14:32 — forked from LeaVerou/dabblet.css
Demo of shape-outside: border-box; by Lea Verou
/*
Demo of shape-outside: border-box; by Lea Verou
Original CSS Shapes demo by Sara Soueidan
*/
@import url(http://fonts.googleapis.com/css?family=Open+Sans:400italic,700italic,400);
.demo {
margin: 50px auto;
width: 100%;
@fazlurr
fazlurr / dabblet.css
Created June 22, 2014 14:32 — forked from LeaVerou/dabblet.css
Color tinting images
/**
* Color tinting images
* Important: Blending modes need to be enabled (Chrome: Experimental Web Platform Features flag, Firefox: layout.css.background-blend-mode.enabled pref)
* Photo: https://flickr.com/photos/tangledcontrolpads/246642987
*/
height: 100vh;
background: url('https://c1.staticflickr.com/1/85/246642987_df591a5a33_b.jpg') no-repeat center hsl(335, 100%, 50%);
background-size: cover;
background-blend-mode: luminosity;
/**
* http://stackoverflow.com/questions/5460129/drop-shadow-only-bottom-css3/5474913
*/
html, body:hover { background: white }
body {
background: #3D668F;
height: 54px;
width: 84px;
@fazlurr
fazlurr / awesome-wordpress-favicons.php
Created June 22, 2014 14:03 — forked from jhned/awesome-wordpress-favicons
Custom Favicons on WP Admin
<?php
// First, create a function that includes the path to your favicon
function add_favicon() {
$favicon_url = get_stylesheet_directory_uri() . '/images/icons/admin-favicon.ico';
echo '<link rel="shortcut icon" href="' . $favicon_url . '" />';
}
// Now, just make sure that function runs when you're on the login page and admin pages
add_action('login_head', 'add_favicon');
add_action('admin_head', 'add_favicon');
@fazlurr
fazlurr / radio-swap.js
Created June 22, 2014 13:47 — forked from jhned/radio-swap
Give the label of a radio button a checked class when the input changes.
jQuery(function($) {
$(':radio').change(function () {
// First, clear out all radio buttons
$(':radio[name=' + this.name + ']').parent().removeClass('checked');
// Add the checked class to the parent. (probably a label)
$(this).parent().addClass('checked');
});
@fazlurr
fazlurr / mobile-detection.php
Created June 22, 2014 12:51 — forked from jhned/mobile-detection
Handheld device detection, courtesy of http://detectmobilebrowsers.com/
<?php
function isMobilePhone() {
$useragent=$_SERVER['HTTP_USER_AGENT'];
if(preg_match('/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i',$useragent)||preg_match('/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1
@fazlurr
fazlurr / WP_Query_Args.php
Last active April 23, 2025 07:21 — forked from billerickson/gist:3698476
WP_Query arguments list
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.com
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query
* Source: http://core.trac.wordpress.org/browser/tags/3.3.1/wp-includes/query.php
*/
$args = array(