Skip to content

Instantly share code, notes, and snippets.

View logichub's full-sized avatar

Kashif Rafique logichub

View GitHub Profile
@khromov
khromov / wp-users-media.php
Created May 16, 2014 09:44
wp-users-media.php Plugin
<?php
/**
* Plugin Name: WP Users Media
* Plugin URI: http://www.wknet.com/wp-users-media/
* Description: WP Users Media is a WordPress plugin that displays only the current users media files and attachments in WP Admin.
* Version: 1.0.3
* Author: Damir Calusic
* Author URI: http://www.damircalusic.com/
* License: GPLv2
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
@mor10
mor10 / advanced-featured-image.php
Last active August 29, 2015 14:01
Advanced responsive featured image function utilizing transients for caching.
@khromov
khromov / limit-author-view-scope.php
Created May 28, 2014 15:22
Limit author view scope WordPress
<?php
/*
Plugin Name: Limit Author View scope
Plugin URI:
Description: Limits non-admins to only see their own media and comments.
Version: 2014.05.28
Author: khromov
Author URI: https://profiles.wordpress.org/khromov
License: GPL2
*/
@pburtchaell
pburtchaell / styles.css
Last active August 29, 2015 14:06
Pure CSS nav-toggle icon
html {
font-size: 17px;
}
@base: 1rem;
.nav-toggle {
display: block;
position: relative;
@khromov
khromov / isMobile.js
Created October 2, 2014 13:23
Mobile detection
/*
* Tiny mobile detection script, courtesy of
* https://github.com/markdalgleish/stellar.js/issues/37
*/
var isMobile = {
Android: function() {
return navigator.userAgent.match(/Android/i);
},
BlackBerry: function() {
return navigator.userAgent.match(/BlackBerry/i);
@bearded-avenger
bearded-avenger / blur.less
Created October 27, 2014 13:20
CSS Blur - No IE Support
.abs-pos-img-div {
position: absolute;
top:0;
left:0;
width:100%;
height:100%;
background-size:cover;
background-position:center center;
z-index: 0;
.translate3d(0, 0, 0);
@MindyPostoff
MindyPostoff / gist:9c7087e170f9cf327f26
Last active August 29, 2015 14:09
Display "Low Stock" Message on WooCommerce Product Page Instead of "Only # Left in Stock"
/* Change the 'Only # left in stock' message on the WooCommerce product page to
* simply show 'Low Stock'.
* Add to your theme's functions.php file
*/
function custom_stock_totals($availability_html, $availability_text, $product) {
if (substr($availability_text,0, 4)=="Only") {
$availability_text = "Low Stock";
}
$availability_html = '<p class="stock ' . esc_attr( $availability['class'] ) . '">' . esc_html( $availability_text ) . '</p>';
return $availability_html;
@zanematthew
zanematthew / welcome.php
Created December 12, 2014 17:27
Note this is a snippet from a class, you can replace the $this-> with your params or hardcode them. Its all ran during admin_init.
<?php
/**
* Sends user to the start page on first activation, as well as each time the
* plugin is upgraded to a new version
*
* @access public
* @since 1.1
* @return void
*/
anonymous
anonymous / my.css
Created December 29, 2014 20:22
CSS Gradient Animation
background: linear-gradient(270deg, #5b318c, #000000);
background-size: 400% 400%;
-webkit-animation: AnimationName 10s ease infinite;
-moz-animation: AnimationName 10s ease infinite;
-o-animation: AnimationName 10s ease infinite;
animation: AnimationName 10s ease infinite;
@-webkit-keyframes AnimationName {
    0%{background-position:0% 50%}
    50%{background-position:100% 50%}
    100%{background-position:0% 50%}
@khromov
khromov / capital_p_dangit_perf.php
Last active August 29, 2015 14:13
capital_P_dangit performance impact tester
<?php
/*
Plugin Name: capital_P_dangit performance test
Plugin URI:
Description: Use shortcode on any page: [capital_P_dangit_performance count="10000"]
Version: 1.0
Author: khromov
Author URI: http://snippets.khromov.se
License: GPL2
*/