Skip to content

Instantly share code, notes, and snippets.

View roachhd's full-sized avatar

Lachlan Seward roachhd

View GitHub Profile
@roachhd
roachhd / README.md
Created October 30, 2014 13:41
.htaccess file tips tricks and easy stuff I didn't know.

Pointing your home site's URL to a subdirectory In some cases, you may have a WordPress site that changes significantly every year, such as with a conference website. If you want to install each year's version of the site in a subdirectory, such as /2010, /2011, and /2012, but have the root domain (yoursite.com) automatically redirect to a particular subdirectory (usually the latest), follow this technique:

Install WordPress in a subdirectory, such as /2012. In your root folder (not the subdirectory folder), download and open your .htaccess file.

Add the following to your .htaccess file:

RewriteEngine On

RewriteCond %{HTTP_HOST} ^(www.)?YourDomain.com$

function get_avatar_from_service(service, userid, size) {
// this return the url that redirects to the according user image/avatar/profile picture
// implemented services: google profiles, facebook, gravatar, twitter, tumblr, default fallback
// for google use get_avatar_from_service('google', profile-name or user-id , size-in-px )
// for facebook use get_avatar_from_service('facebook', vanity url or user-id , size-in-px or size-as-word )
// for gravatar use get_avatar_from_service('gravatar', md5 hash email@adress, size-in-px )
// for twitter use get_avatar_from_service('twitter', username, size-in-px or size-as-word )
// for tumblr use get_avatar_from_service('tumblr', blog-url, size-in-px )
// everything else will go to the fallback
// google and gravatar scale the avatar to any site, others will guided to the next best version
@roachhd
roachhd / README.md
Last active August 29, 2015 14:08
Bootstrap + Bootswatch = 💓 a Bootswatch API test.

Bootswatch API test

######Bootstrap is awesome! But for stylin' awesomeness in seconds Just add Bootswatch! Play with the API demo in this Gist here

☕ & ❤

@roachhd
roachhd / README.md
Last active August 29, 2015 14:08
GET SOCIAL 🙌 ... all my profiles links, cos its all about me you know 😉
@roachhd
roachhd / README.md
Created November 2, 2014 11:01
Jekyll ruby gems for GitHub pages 💁

npm version

@roachhd
roachhd / README.md
Last active August 29, 2015 14:08
my super simple standard .editorconfig File

This is my super simple and very standard .editorconfig File.

# editorconfig.org
  root = true
  [*]
  indent_style = space
  indent_size = 2
  end_of_line = lf
  charset = utf-8

trim_trailing_whitespace = true

@roachhd
roachhd / README.md
Last active December 11, 2022 07:18
CSS Animation cheatsheet featuring Mr T.

A collection of awesome CSS animations featuring the super Mr T.

@roachhd
roachhd / README.md
Created November 5, 2014 11:02
Simple To Do list

Super Simple Hack List

To do

  • Make pretty
  • Post to my blog
  • Share on Twitter

Next

@roachhd
roachhd / index.html
Created November 5, 2014 23:51
easily center an image with css
<section class="content about">
<h1 class="big thin">The PURPLE OWL</h1>
<img src="http://www.clker.com/cliparts/J/Q/T/y/5/i/purple-orange-owl-hi.png" class="noclip" style="display: block;margin-left: auto;margin-right: auto;" />
require 'fileutils'
require 'digest/md5'
require 'redcarpet'
require 'pygments'
class Redcarpet2Markdown < Redcarpet::Render::HTML
def block_code(code, lang)
lang = lang || "text"
colorized = Pygments.highlight(code, :lexer => lang, :options => { :style => "default", :encoding => 'utf-8'})
add_code_tags(colorized, lang)