Skip to content

Instantly share code, notes, and snippets.

View mauryaratan's full-sized avatar
🦌

Ram Ratan Maurya mauryaratan

🦌
View GitHub Profile
@mauryaratan
mauryaratan / sublime-settings.json
Last active December 17, 2015 13:59
My Sublime Text settings. Better to keep the safe and open.
{
"bold_folder_labels": true,
"color_scheme": "Packages/Theme - Spacegray/base16-ocean.dark.tmTheme",
"ensure_newline_at_eof_on_save": true,
"file_exclude_patterns":
[
"*.DS_Store",
"*.git",
"*.sass-cache"
],
/*
* RGBa-Mixin with fallback (http://css-tricks.com/rgba-browser-support/)
*/
@mixin transparent-backgound($color: #000, $value:0.5)
$start: "rgb(";
$end: ")";
background: #{$start}red($color), green($color), blue($color)#{$end};
background: rgba($color, $value);
@mauryaratan
mauryaratan / stag-shortcodes-1.0.txt
Created July 20, 2013 05:11
Codestag's Shortcode builder's shortcodes list for v1
Alerts
======
[stag_alert style="white"]Your Alert![/stag_alert]
Styles: white, grey, red, yellow, green, blue
Buttons
=======
@mauryaratan
mauryaratan / stagtools.txt
Last active August 14, 2017 07:51
StagTools WordPress Plugin's list of all available shortcodes, just in case you want to use theme manually instead of shortcode builder.
Alerts
======
[stag_alert style="white"]Your Alert![/stag_alert]
Styles: white, grey, red, yellow, green, blue
Buttons
=======
@mauryaratan
mauryaratan / extends.scss
Last active December 21, 2015 20:49
Useful Sass Mixins and extend, usable in most projects.
// Clearfix
%clearfix {
zoom: 1;
&:before,
&:after {
display: table;
content: "";
}
&:after {
clear: both;
# git clone [email protected]:WordPress/WordPress.git .
# TODO: Add support for props that list multiple people
git log -i --grep props | egrep -io 'props (to )?[a-z0-9_\-]*' | sed 's/.* //' | sort | uniq -c | sort -k1nr > shortlog.txt
@mauryaratan
mauryaratan / diff.js
Created November 14, 2013 12:53
Filter out the unnecessary tag filters. Used in http://demo.codestag.com/forest/
var all_filters = $('#all-skills').data('all-filters'),
all_skills = $('#all-skills').data('all-skills');
all_filters.filter(function(i,v){
if( all_skills.indexOf(i) === -1 ) {
var diff = all_filters[v];
$('.portfolio-filter').find("[data-filter='"+ diff +"']").addClass('invalid');
}
});
@mauryaratan
mauryaratan / google-font-fix.css
Created March 25, 2014 12:33
Fix for Google web fonts rendering bug appeared in Chrome v33.
body {
-webkit-animation-duration: 0.1s;
-webkit-animation-name: fontfix;
-webkit-animation-iteration-count: 1;
-webkit-animation-timing-function: linear;
-webkit-animation-delay: 0.1s;
}
@-webkit-keyframes fontfix {
from { opacity: 1; }
@mauryaratan
mauryaratan / woocommerce-search-filter.php
Created April 2, 2014 12:21
Make your WordPress site use WooCommerce product archives search pages by default.
<?php
function crux_search_filter( $query ) {
if ( $query->is_search ) {
$query->set( 'post_type', 'product' );
$query->is_archive = true;
$query->is_post_type_archive = true;
}
return $query;
@mauryaratan
mauryaratan / functions.php
Created April 10, 2014 14:38
Allow shortcodes to be used under text widget.
<?php
// Filters that allow shortcodes in Text widgets
add_filter( 'widget_text', 'shortcode_unautop' );
add_filter( 'widget_text', 'do_shortcode' );