This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module LoginMacros | |
def stub_env_for_omniauth | |
request.env['devise.mapping'] = Devise.mappings[:user] | |
env = { "omniauth.auth" => OmniAuth.config.mock_auth[:twitter] } | |
@controller.stub!(:env).and_return(env) | |
end | |
def login_user | |
before(:each) do |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
devise_for :user, :path => 'account', :path_names => | |
{ | |
:sign_in => 'login', | |
:sign_out => 'logout', | |
:invitation => 'invite' | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@media only screen and (min-device-width: 320px) and (max-device-width: 1024px) | |
html | |
-webkit-text-size-adjust: none |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
layout: default | |
title: All Posts | |
category: blog | |
--- | |
<div id="blog"> | |
<h2>{{page.title}}</h2> | |
{% for post in site.categories.blog %} | |
{% capture post_month %}{{post.date | date: "%m"}}{% endcapture %} | |
{% if post_month != prev_post_month %}{% if prev_post_month %}</ol>{% endif %}<h3>{{post.date | date: "%B %Y"}}</h3><ol class="blog-list">{% endif %} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
layout: blog-post | |
title: A super ghetto way of getting a function path in AS3 | |
shortname: AS3 Function Path | |
category: blog | |
tags: [AS3, Code, Open Source] | |
thumbnail: | |
image: as3-function-path-thumb.jpg | |
colors: ['b8190c', 'ccac7b', 'cee3eb', '899088'] | |
--- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Jekyll | |
class Post | |
alias :super_to_liquid :to_liquid | |
def to_liquid | |
super_to_liquid.deep_merge({"slug" => slug}) | |
end | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Jekyll | |
module Filters | |
def remarry_widows(input) | |
newinput = input.gsub(/ ([^ ]+)$/, " \\1") | |
newinput | |
end | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Jekyll | |
class Site | |
require 'growl' | |
alias :super_process :process | |
def process | |
time = Time.now | |
super_process() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Jekyll | |
class Pagination < Generator | |
# This generator is safe from arbitrary code execution. | |
safe true | |
# Generate paginated pages if necessary. | |
# | |
# site - The Site. | |
# |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'tidy_ffi' | |
desc "Tidies HTML files" | |
task :tidy do | |
Dir.glob('site/**/*.html') do |path| | |
content = File.open(path).read | |
File.open(path, 'w') {|file| | |
file.write TidyFFI::Tidy.new(content, :numeric_entities => 1, :output_html => 1, :merge_divs => 0, :merge_spans => 0, :join_styles => 0, :clean => 1, :indent => 1, :wrap => 0, :drop_empty_paras => 0, :literal_attributes => 1).clean |