Skip to content

Instantly share code, notes, and snippets.

View palimadra's full-sized avatar

Pali Madra palimadra

View GitHub Profile
@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 / 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 / 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 / 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 / post-title-capitalize
Created October 16, 2014 07:29
Capitalize post titles
<?php
//capitalise titles in wordpress
add_filter('the_title', 'ucwords');
@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 / 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 / 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 / favicon
Created September 20, 2014 10:46
favicon code as per HTML5 guidelines
<!-- Favicon code based on HTML5 guidelines. The answer is taken from a stackoverflow question and answer on -->
<!-- For IE 9 and below. ICO should be 32x32 pixels in size -->
<!--[if IE]><link rel="shortcut icon" href="path/to/favicon.ico"><![endif]-->
<!-- IE 10+ "Metro" Tiles - 144x144 pixels in size -->
<meta name="msapplication-TileColor" content="#D83434">
<meta name="msapplication-TileImage" content="path/to/tileicon.png">
<!-- Touch Icons - iOS and Android 2.1+ 152x152 pixels in size. -->
@palimadra
palimadra / .gitignore
Last active August 29, 2015 14:06 — forked from octocat/.gitignore
Some common gitmore instructions which should be added to a gitmore file in a github repository. A gitmore file has instructions on which files to exclude in a github sync therefore some common files need to be ignored if you have repository on which you are working locally.
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #