Skip to content

Instantly share code, notes, and snippets.

Ram Ratan Maurya mauryaratan

Block or report user

Report or block mauryaratan

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
mauryaratan / stagtools.txt
Last active Aug 14, 2017
StagTools WordPress Plugin's list of all available shortcodes, just in case you want to use theme manually instead of shortcode builder.
View stagtools.txt
[stag_alert style="white"]Your Alert![/stag_alert]
Styles: white, grey, red, yellow, green, blue
mauryaratan / stag-shortcodes-1.0.txt
Created Jul 20, 2013
Codestag's Shortcode builder's shortcodes list for v1
View stag-shortcodes-1.0.txt
[stag_alert style="white"]Your Alert![/stag_alert]
Styles: white, grey, red, yellow, green, blue
View RGBa-Mixin with fallback for sass.scss
* RGBa-Mixin with fallback (
@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 / sublime-settings.json
Last active Dec 17, 2015
My Sublime Text settings. Better to keep the safe and open.
View sublime-settings.json
"bold_folder_labels": true,
"color_scheme": "Packages/Theme - Spacegray/base16-ocean.dark.tmTheme",
"ensure_newline_at_eof_on_save": true,
mauryaratan / custom-file.php
Last active Dec 17, 2015
Custom CSS file generation in WordPress
View custom-file.php
function stag_link_custom_styles(){
$output = '';
if(apply_filters('stag_custom_styles', $output)){
$perma_structure = get_option('permalink_structure');
$url = home_url(). '/stag-custom-styles.css?'.time();
if(!$perma_structure) $url = home_url(). '?page_id=stag-custom-styles.css';
echo '<link rel="stylesheet" href="'.$url.'" type="text/css" media="screen" />';
mauryaratan / wordpress-functions.php
Created Mar 11, 2013
Useful WordPress functions for random needs.
View wordpress-functions.php
function is_sidebar_active( $index = 1){
$sidebars = wp_get_sidebars_widgets();
$count = count($sidebars['sidebar-'.$index]);
if($count === 0){
return false;
return true;
mauryaratan / Mac-folder-clean.txt
Created Feb 14, 2013
Compress your files without including .DS_Store with single line command.
View Mac-folder-clean.txt
zip -r foo -x "*.DS_Store"
To interpret this, we are running the zip executable with the following parameters/arguments:
-r for recursively including all directories underneath the targets we want to zip. is the name of the zip archive we are creating
foo is the target directory we want to zip up
-x "*.DS_Store" excludes all files whose path ends in the string ".DS_Store"
mauryaratan / WP3.5 Media Upload API.js
Last active Dec 10, 2015
A slightly improved version of WP3.5 Media Uploader than previous version, just to stay safe. Don't forget to use wp_enqueue_media(); to avoid any error.
View WP3.5 Media Upload API.js
// Uploading files
var file_frame;
jQuery('.upload_image_button').live('click', function( event ){
// If the media frame already exists, reopen it.
if ( file_frame ) {;
mauryaratan / body_classes.js
Last active Dec 10, 2015
Add body classes for browser, OS and retina display support.
View body_classes.js
$(function() {
var browser, classList, os, platform, retina;
retina = window.devicePixelRatio > 1 ? "retina" : "no-retina";
platform = window.navigator.userAgent;
if (/Chrome/.test(platform)) {
browser = "chrome";
} else if (/Firefox/.test(platform)) {
browser = "firefox";
} else {
browser = "unknown-browser";
mauryaratan / SCSS Mixins.scss
Last active Oct 14, 2015
Useful SCSS Mixins
View SCSS Mixins.scss
@mixin md($case){
.#{$case} &{
@mixin the-bg($trans: 1){
background: url(assets/img/pixel-#{$trans}.png) repeat;
background: rgba(black, ($trans/10));
You can’t perform that action at this time.