Skip to content

Instantly share code, notes, and snippets.

View imathis's full-sized avatar
🍽️
Hungry for biscuits.

Brandon Mathis imathis

🍽️
Hungry for biscuits.
View GitHub Profile
@imathis
imathis / gist:1211531
Created September 12, 2011 15:20
Beauty in SCSS
// SCSS
nav {
  &.top-nav { li { margin:{ top:0; left:0; }}} // some comment
}
vs.
// Sass
nav
&.top-nav
@imathis
imathis / gist:1218226
Created September 15, 2011 00:37 — forked from henneonrails/gist:1217518
dot files
desc "copy dot files for deployment"
task :copydot do
exclusions = [".", "..", ".DS_Store"]
Dir["#{source_dir}/**/.*"].each do |file|
if (!File.directory?(file) && !exclusions.include?(file))
cp(file, file.gsub(/#{source_dir}/, "#{public_dir}"));
end
end
end
@imathis
imathis / quiche.markdown
Created November 2, 2011 23:37
Crustless Quiche

Dependencies

  • 10 oz pkg frozen spinach, thawed, drained, chopped
  • 3 eggs
  • 12 oz cottage cheese
  • 3 TBsp flour
  • 2 TBsp butter, melted
  • 8 oz shredded cheddar cheese

Setup

@imathis
imathis / _partial.markdown
Created January 9, 2012 02:22
Render Markdown partials in HTML with Octopress

{% capture partial %} bold italic link {% endcapture %}

@imathis
imathis / 2.1-preview.markdown
Last active September 30, 2015 14:58
How to beta test Octopress 2.1 (including link logs)

Before you get started

Be aware this is a preview. Don't merge this into your main branch and run along using it. I've tested it a lot but there may be issues I'm unaware of. Create a test branch for your blog before you continue. When everything gets cleared up, I'll release this feature and you can pull from the master branch.

First be sure you have a remote pointing to the Octopress repository. git remote -v should return something like this:

octopress      git://github.com/imathis/octopress.git (fetch)
@imathis
imathis / task.rb
Created March 27, 2012 18:56
Edit Octopress post
desc "Edit a post (defaults to most recent)"
task :edit_post, :title do |t, args|
args.with_defaults(:title => false)
posts = Dir.glob("#{source_dir}/#{posts_dir}/*.*")
post = (args.title) ? post = posts.keep_if {|post| post =~ /#{args.title}/}.last : posts.last
if post
puts "Opening #{post} with #{editor}..."
system "#{ENV['EDITOR']} #{post} &"
else
puts "No posts were found with \"#{args.title}\" in the title."
@imathis
imathis / gist:2788340
Created May 25, 2012 14:10
Automated Drafts in Octopress

Why I don't like automated time delayed publishing of drafts in Octopress:

  1. It's not hard to publish a draft when you want to.
  2. It may be hard to set up due to development environment issues.
  3. There are lots of edge cases that aren't obvious at first. Supporting this won't be easy.
  4. People could accidentally push a broken site.

Example

You're working on a plugin for Octopress and your task timer goes off. Your blog just starts generating and deploying in the background but you're in a development branch working on some feature. Result: your script generates your test site, but not your blog, and pushes it live in the background.

@imathis
imathis / tweetbot-mute-regex.md
Created June 27, 2012 19:45
Tweetbot can use regular expressions to mute tweets in your timeline and mentions.

Hashtag abuse

Three or more hashtags.

#[^#]+#[^#]+#

Long hashtags (15+ characters): #hashtagpunchline

<h1>CSS3 Checkbox Styles</h1>
<!-- Slide ONE -->
<div class="slideOne">
<input type="checkbox" value="None" id="slideOne" name="check" />
<label for="slideOne"></label>
</div>
<!-- Slide TWO -->
<div class="slideTwo">