Skip to content

Instantly share code, notes, and snippets.

View palimadra's full-sized avatar

Pali Madra palimadra

View GitHub Profile
@palimadra
palimadra / gist:effa522bd48f13a06167
Created October 1, 2014 19:10
Emmet shortcuts less used
<!-- Skip The Div #1 -->
div.container
<!-- Skip The Div #2 -->
.container
<!-- Implicit Tag Names -->
.wrap>ul.list>.sites
<!-- Chaining Abbreviations -->
@palimadra
palimadra / style
Created October 16, 2014 07:21
A CSS file for a WordPress theme
a,abbr,acronym,address,applet,article,aside,audio,b,big,blockquote,body,canvas,caption,center,cite,code,dd,del,details,dfn,div,dl,dt,em,embed,fieldset,figcaption,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,html,i,iframe,img,ins,kbd,label,legend,li,mark,menu,nav,object,ol,output,p,pre,q,ruby,s,samp,section,small,span,strike,strong,sub,summary,sup,table,tbody,td,tfoot,th,thead,time,tr,tt,u,ul,var,video {
margin: 0;
padding: 0;
border: 0;
font: inherit;
vertical-align: baseline;
}
article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section {
display: block;
@palimadra
palimadra / wordpress-version-hide
Created October 16, 2014 07:27
Remove WordPress version or stop WordPress version from being shown
<!-- /* Remove version number from wordpress generated source and RSS feed.
http://www.wpbeginner.com/wp-tutorials/the-right-way-to-remove-wordpress-version-number/
*/ -->
<!-- /* remove this from header.php remove version from generated page source */ -->
<meta name="generator" content="WordPress <?php bloginfo('version'); ?>" />
<!-- /* or add this to functions.php to remove version from generated page source */ -->
<?php remove_action('wp_head', 'wp_generator'); ?>
@palimadra
palimadra / post-title-capitalize
Created October 16, 2014 07:29
Capitalize post titles
<?php
//capitalise titles in wordpress
add_filter('the_title', 'ucwords');
@palimadra
palimadra / functions
Created October 16, 2014 07:33
functions.php for wordpress
<?php
/**
* Load a custom template for vendor taxonomy
*/
function load_custom_vendor_template( $located ) {
global $wc_product_vendors;
if( is_tax( $wc_product_vendors->token ) ) {
return get_template_directory() . '/woocommerce/taxonomy-shop_vendor.php'; // Change here the file name if needed
}
@palimadra
palimadra / wp-main
Created October 16, 2014 07:46
CSS for another wordpress website
@font-face {
font-family:dashicons;
src:url(/wp-includes/css/../fonts/dashicons.eot)
}
@font-face {
font-family:dashicons;
src:url(data:application/x-font-woff;charset=utf-8;base64,d09GRgABAAAAAFk8AA4AAAAAkVwAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABGRlRNAAABRAAAABwAAAAca/GHnkdERUYAAAFgAAAAHgAAACABIAAET1MvMgAAAYAAAABAAAAAYJAJaVBjbWFwAAABwAAAATMAAAKSUPpEamdhc3AAAAL0AAAACAAAAAj//wADZ2x5ZgAAAvwAAE2qAAB6bNqcwBtoZWFkAABQqAAAAC4AAAA2BqJsMGhoZWEAAFDYAAAAGgAAACQPogicaG10eAAAUPQAAAEhAAADzAu/zfNsb2NhAABSGAAAAeAAAAHox87m5m1heHAAAFP4AAAAHwAAACABRgC1bmFtZQAAVBgAAAFzAAADBkirZW9wb3N0AABVjAAAA6cAAAmJ0RPelXdlYmYAAFk0AAAABgAAAAZeiFO0AAAAAQAAAADMPaLPAAAAAM/Z1ckAAAAAz9oPBXjaY2BkYGDgA2IJBhBgYmAEwk9AzALmMQAADrABJQAAeNpjYGZvYZzAwMrAwirCsoGBgWEahGbaw2DEFAHkA6Wwg1DvcD8GBwWGr4LsF0B8IKkBpBiRlCgwMAIA9/UJS3ja3ZAxSwNBEIVnczFwub25CyoYsFgQi1QGCzHdGRGTQhEiaLRIVFCCCEklKYSAWAgWtv4L/4yNFgkKiuXszlZGziMRC3sbH8wbHjy+4gGAA+ObBZE4iJskiVFOi3bydyGCCZhRWbWgGvNDcmmS8jRHBSrSEpVoldaoQnU6oBZ16UoL7eq8LuiSjnTZuCZvCqZkqlzlHa5zk1vc5Wu+s2nr2lwcAyj4JgOFNE
@palimadra
palimadra / add-to-feedly-bookmarklet
Created October 17, 2014 20:00
Bookmarklet to add rss feed of a website to feedly in any browser
(function() {
void(d = document);
void(el = d.getElementsByTagName('link'));
void(g = false);
void(count = 0);
for (i = 0; i < el.length; i++) {
if (el[i].getAttribute('rel').indexOf('alternate') != -1) {
if(count == 0) {
ty = el[i].getAttribute('type');
if(ty.indexOf('application/rss+xml') != -1 || ty.indexOf('text/xml') != -1) {
@palimadra
palimadra / boxed-neat-reddit
Created October 24, 2014 16:20
A reddit stylesheet for subreddits
/*
<removereasons>
<pmsubject>
Your {kind} {title} was removed from /r/{subreddit}.
</pmsubject>
<reason>Your {kind} has been removed for
<select id="selectbox">
<option>racism</option>
@palimadra
palimadra / clean-reddit
Created October 24, 2014 16:25
Stylesheet for subreddits on reddit and their wikis
/* Body
------------------------------------- */
/* Links */
a:hover {
text-decoration: none!important;
}
/* Quotes */
.md blockquote {
padding: 1px 5px;
@palimadra
palimadra / subreddit-stylesheet
Created October 24, 2014 16:40
Subreddit stylesheet
/* -------------------------------------------------
The style sheet is from the subreddit at
http://www.reddit.com/r/GetMotivated
The reason the stylesheet has been copied
is because it seems to follow for writing
css. For example defining the colors at the start.
Another reason is to see how an image can be