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 / _index.scss
Created May 29, 2013 17:31
Potential way for allowing optional customization.
@import "../custom/theme/_colors.*"; // can set defaults to override theme colors
@import "colors"; // Sets colors with $color: #aaa !default;
@imathis
imathis / additive-assign-and-capture.md
Last active December 17, 2015 19:58
A proposal for how assign and capture could be extended to support appending to variables instead of simply assigning and thus overwriting them.

Append with capture/assign

I want to allow people to append to a varaible with capture or assign. Here is a syntax proposal. It was trivial to implement and it works with all new capture and assign modifications (post condition, ternary, etc).

Syntax

The main problem is which operator should I use. += or >>.

{% assign foo = 'yo' %} // "yo"
@imathis
imathis / footnotes.diff
Created May 7, 2013 05:57
Diff for adding footnotes to Octopress
diff --git a/.themes/classic/sass/base/_typography.scss b/.themes/classic/sass/base/_typography.scss
index 85256f0..9a6bbac 100644
--- a/.themes/classic/sass/base/_typography.scss
+++ b/.themes/classic/sass/base/_typography.scss
@@ -80,10 +80,12 @@ strong { font-weight: bold; }
em { font-style: italic; }
-sup, sub { font-size: 0.8em; position: relative; display: inline-block; }
+sup, sub { font-size: 0.75em; position: relative; display: inline-block; padding: 0 .2em; line-height: .8em;}
testing stuff
does this work?
@imathis
imathis / class-name-helpers.coffee
Created December 14, 2012 17:35
Handy little jQuery extensions for working with time based class names.
(($) ->
# Add a class until a period of time. Fires a callback when complete
$.fn.addClassUntil = (className, time=400, onComplete = (->true))->
el = this
el.addClass className
setTimeout (-> el.removeClass(className); onComplete()), time
this
# Add a class after a period of time. Fires a callback when complete
$.fn.addClassAfter = (className, time=400, onComplete = (->true))->
<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">
@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

@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 / 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 / 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)