Skip to content

Instantly share code, notes, and snippets.

View paulmsmith's full-sized avatar

Paul Smith paulmsmith

View GitHub Profile
@paulmsmith
paulmsmith / zencoding snippet.txt
Created August 28, 2012 14:33
Bad Ass bit of ZenCoding without even thinking about it.
section.tmd-block.group>article.title-media-desc*6>(h3.title>a[href="#$"]{Title $})+(div.media>a[href="#$"]>img[src="/images/temp.jpg" alt=""])+(div.desc>p{Lorem ipsum dolor sit amet, consectetuer adipiscing elit.})
@paulmsmith
paulmsmith / tmd-block.html
Created August 28, 2012 15:48
title media description block
<section class="tmd-block tmd-block-about group">
<article class="title-media-desc">
<h3 class="title"><a href="#1">Title 1</a></h3>
<div class="media"><a href="#1"><img src="/images/temp.jpg" alt=""></a></div>
<div class="desc">
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</p>
<p class="cta"><a href="#">Find out more</a></p>
</div>
</article>
<article class="title-media-desc">
@paulmsmith
paulmsmith / repsond_mixins.scss
Created September 19, 2012 09:57
amended respond-min and respond-max from @jaffathecake
@mixin respond-min($width, $fix-mqs: $fix-mqs) {
// If we're outputting for a fixed media query set...
@if $fix-mqs {
// ...and if we should apply these rules...
@if $fix-mqs >= $width {
// ...output the content the user gave us.
@content;
}
}
@else {
@paulmsmith
paulmsmith / iphonecss.scss
Created October 15, 2012 14:59
gibbo text iphone thingy
html { -webkit-text-size-adjust: none; /* Prevent font scaling in landscape */ }
@paulmsmith
paulmsmith / jek_inc_example.html
Created October 16, 2012 09:42
Jekyll Include with var example
## using the includes and setting the var
{% assign themetitle = 'text text' %}
{% include modules/theme_title.html %}
{% assign themetitle = 'new title text' %}
{% include modules/theme_title.html %}
## contents of theme_title.html
@paulmsmith
paulmsmith / sublime-commandline-snippet.txt
Created November 20, 2012 15:35
sublime command when rvm installed
ln -s "/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl" ~/.rvm/bin/subl
@paulmsmith
paulmsmith / mixtureplease.txt
Created December 10, 2012 11:29
mixture please lord do this
{% include modules/module.html title="mixture" description="New kid on the block" imgPath="screenshots/mixture.jpg" ctaURL="http://mixture.io" %}
{% include modules/module.html title="jekyll" description="the old hand" imgPath="screenshots/jekylljpg" ctaURL="https://github.com/mojombo/jekyll/" %}
contents of module.html
<h1>{{ title }}</h1>
<p><img src="{{ imgPath }}" /></p>
<p>{{ description }}</p>
<p><a href="{{ ctaURL }}">Official site</a></p>
@paulmsmith
paulmsmith / rake_new_module.txt
Created March 6, 2013 18:11
new module rake task
# CREATE NEW MPP MODULE
desc 'New module'
task :newmodule do
if mac?
moduleName = ENV["name"]
if moduleName.nil? || moduleName == 0
puts "\nMPP ERROR NOTE: You need to give a module name. e.g. 'rake name=test newmodule'\n"
else
touch "_assets/css/modules/#{moduleName}.scss"
touch "_includes/modules/#{moduleName}.html"
@paulmsmith
paulmsmith / partial.html.erb
Created March 14, 2013 11:54
erb for partial include - manual without helper in middleman
<div class="<%= module_class %><% if modifiers %><% for item in modifiers %><%= " " + module_class + "--" + item %><% end %><% end %>">
<%= lorem.paragraph %>
</div>
@paulmsmith
paulmsmith / sass-ie-rem-mixin.scss
Created March 26, 2013 15:43
sass-ie-rem-mixin
// rem font and line-height mixin. Accepts a font-size, line-height and ratio numeric (without unit, "14" - not "14px")
// the line height defaults to the passed font-size and the ratio defaults to 1.5 (150%)
// as the body is 62.5% we can use base10 to determin the REM value and just append px for the pixel fallback
@mixin font-size($size: 14, $line: $size, $ratio: 1.5){
// size variables
$remValueFontSize: ($size / 10) + rem;
$remValueLine: ($line / 10) * $ratio + rem;
$pxValueFontSize: floor($size) + px;
$pxValueLine: floor($size * $ratio) + px;