Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: marksim/blog
base: 73c9e67138
...
head fork: marksim/blog
compare: 4c17242fb8
Checking mergeability… Don't worry, you can still create the pull request.
  • 10 commits
  • 9 files changed
  • 0 commit comments
  • 5 contributors
Commits on Jan 14, 2012
@robertkowalski robertkowalski Fix CRLF, closes #374 6dacdbf
Commits on Mar 07, 2012
@imathis imathis Merge pull request #376 from robertkowalski/clrf
Fix CRLF, closes #374
9f40242
Commits on Mar 23, 2012
@lukekarrys lukekarrys Don't display comments link for post excerpts on index page when comm…
…ents for that post are set to false.
8b8fff3
Commits on May 19, 2012
@imathis imathis updated to latest version of Sass, fixed deprecation warnings d71223c
Commits on May 20, 2012
@acusti acusti Fixed “3rd party plugins” wiki page link
Signed-off-by: Brandon Mathis <brandon@imathis.com>
c5e2e52
Commits on May 21, 2012
@imathis imathis Octopress filters are now limited to html producing templating langua…
…ges, Fixes #536
8753a6b
Commits on May 22, 2012
@imathis imathis Merge pull request #499 from lukekarrys/patch-1
Don't display comments link for post excerpts on index page when comments for that post are set to false
c9d3b0e
Commits on May 23, 2012
@marksim Merge branch 'master' of git://github.com/imathis/octopress
Conflicts:
	Gemfile.lock
adc1262
@marksim Electronic Music is good for coding dc0b383
@marksim DCI generators in rails 4c17242
View
8 .themes/classic/sass/base/_layout.scss
@@ -127,16 +127,17 @@ body.sidebar-footer {
@media only screen and (min-width: 750px) {
aside.sidebar { @include collapse-sidebar; }
}
+#main, #content, .sidebar {
+ @extend .group;
+}
@media only screen and (min-width: 768px) {
body { -webkit-text-size-adjust: auto; }
body > header { font-size: $header-font-size * 1.2; }
#main {
- @extend .group;
padding: 0;
margin: 0 auto;
}
#content {
- @extend .group;
overflow: visible;
margin-right: $sidebar-width-medium;
position: relative;
@@ -149,7 +150,6 @@ body.sidebar-footer {
}
}
aside.sidebar {
- @extend .group;
width: $sidebar-width-medium - $sidebar-pad-medium*2;
padding: 0 $sidebar-pad-medium $sidebar-pad-medium;
background: none;
@@ -180,7 +180,6 @@ body.sidebar-footer {
padding: 1.2em $sidebar-pad-wide $sidebar-pad-wide;
.collapse-sidebar & {
padding: { left: $pad-wide; right: $pad-wide; }
- @extend .group;
}
}
}
@@ -190,3 +189,4 @@ body.sidebar-footer {
ul, ol { margin-left: 0; }
}
}
+
View
5 .themes/classic/sass/partials/_navigation.scss
@@ -13,7 +13,7 @@ body > nav {
.search {
padding: .3em .5em 0;
font-size: .85em;
- @extend .sans;
+ font-family: $sans;
line-height: 1.1em;
width: 95%;
@include border-radius(.5em);
@@ -54,7 +54,7 @@ body > nav {
}
a {
@include link-colors($nav-color, $nav-color-hover, $visited: $nav-color);
- @extend .sans;
+ font-family: $sans;
text-shadow: lighten($nav-bg, 12) 0 1px;
float: left;
text-decoration: none;
@@ -134,3 +134,4 @@ body > nav {
a[rel=subscribe-rss]{ @include mask-subscription-nav('rss.png'); }
a[rel=subscribe-email]{ @include mask-subscription-nav('email.png'); }
}
+
View
2  .themes/classic/source/_includes/article.html
@@ -8,7 +8,7 @@ <h1 class="entry-title">{% if site.titlecase %}{{ page.title | titlecase }}{% el
{% unless page.meta == false %}
<p class="meta">
{% include post/date.html %}{{ time }}
- {% if site.disqus_short_name and page.comments != false and site.disqus_show_comment_count == true %}
+ {% if site.disqus_short_name and page.comments != false and post.comments != false and site.disqus_show_comment_count == true %}
| <a href="{% if index %}{{ root_url }}{{ post.url }}{% endif %}#disqus_thread">Comments</a>
{% endif %}
</p>
View
228 .themes/classic/source/assets/jwplayer/glow/glow.xml
@@ -1,115 +1,115 @@
-<?xml version="1.0"?>
-<skin version="1.1" name="Glow" author="LongTail Video">
-
- <settings>
- <setting name="backcolor" value="0x000000" />
- <setting name="frontcolor" value="0xeeeeee" />
- <setting name="lightcolor" value="0xeeeeee" />
- <setting name="screencolor" value="0x000000" />
- </settings>
-
- <components>
- <component name="controlbar">
- <settings>
- <setting name="margin" value="0" />
- <setting name="fontsize" value="11" />
- <setting name="fontcolor" value="0xEEEEEE" />
- <setting name="buttoncolor" value="0xEEEEEE" />
- </settings>
-
- <layout>
- <group position="left">
- <button name="play" />
- <text name="elapsed" />
- </group>
- <group position="center">
- <slider name="time" />
- </group>
- <group position="right">
- <text name="duration" />
- <button name="blank" />
- <button name="mute" />
- <button name="fullscreen" />
- </group>
- </layout>
-
- <elements>
- <element name="background" src="background.png" />
- <element name="capLeft" src="divider.png" />
- <element name="capRight" src="divider.png" />
- <element name="divider" src="divider.png" />
- <element name="blankButton" src="blankButton.png" />
- <element name="fullscreenButton" src="fullscreenButton.png" />
- <element name="fullscreenButtonOver" src="fullscreenButtonOver.png" />
- <element name="muteButton" src="muteButton.png" />
- <element name="muteButtonOver" src="muteButtonOver.png" />
- <element name="pauseButton" src="pauseButton.png" />
- <element name="pauseButtonOver" src="pauseButtonOver.png" />
- <element name="playButton" src="playButton.png" />
- <element name="playButtonOver" src="playButtonOver.png" />
- <element name="timeSliderBuffer" src="timeSliderBuffer.png" />
- <element name="timeSliderCapLeft" src="timeSliderCapLeft.png" />
- <element name="timeSliderCapRight" src="timeSliderCapRight.png" />
- <element name="timeSliderProgress" src="timeSliderProgress.png" />
- <element name="timeSliderRail" src="timeSliderRail.png" />
- <element name="normalscreenButton" src="normalscreenButton.png" />
- <element name="normalscreenButtonOver" src="normalscreenButtonOver.png" />
- <element name="unmuteButton" src="unmuteButton.png" />
- <element name="unmuteButtonOver" src="unmuteButtonOver.png" />
- <element name="volumeSliderRail" src="divider.png" />
- <element name="volumeSliderProgress" src="divider.png" />
- </elements>
- </component>
-
- <component name="display">
- <settings>
- <setting name="bufferinterval" value="250" />
- <setting name="bufferrotation" value="90" />
- </settings>
- <elements>
- <element name="background" src="background.png" />
- <element name="playIcon" src="playIcon.png" />
- <element name="muteIcon" src="muteIcon.png" />
- <element name="errorIcon" src="bufferIcon.png" />
- <element name="bufferIcon" src="bufferIcon.png" />
- </elements>
- </component>
-
- <component name="dock">
- <settings>
- <setting name="fontcolor" value="0xFFFFFF" />
- </settings>
- <elements>
- <element name="button" src="button.png" />
- </elements>
- </component>
-
- <component name="playlist">
- <settings>
- <setting name="fontcolor" value="0xEEEEEE" />
- <setting name="overcolor" value="0xFFFFFF" />
- <setting name="activecolor" value="0xFFFFFF" />
- <setting name="backgroundcolor" value="0x333333" />
- </settings>
- <elements>
- <element name="item" src="item.png" />
- <element name="itemOver" src="itemOver.png" />
- <element name="sliderCapBottom" src="sliderCapBottom.png" />
- <element name="sliderCapTop" src="sliderCapTop.png" />
- <element name="sliderRail" src="sliderRail.png" />
- <element name="sliderThumb" src="sliderThumb.png" />
- </elements>
- </component>
-
- <component name="sharing">
- <elements>
- <element name="embedIcon" src="embedIcon.png" />
- <element name="embedScreen" src="embedScreen.png" />
- <element name="shareIcon" src="shareIcon.png" />
- <element name="shareScreen" src="shareScreen.png" />
- </elements>
- </component>
-
- </components>
-
+<?xml version="1.0"?>
+<skin version="1.1" name="Glow" author="LongTail Video">
+
+ <settings>
+ <setting name="backcolor" value="0x000000" />
+ <setting name="frontcolor" value="0xeeeeee" />
+ <setting name="lightcolor" value="0xeeeeee" />
+ <setting name="screencolor" value="0x000000" />
+ </settings>
+
+ <components>
+ <component name="controlbar">
+ <settings>
+ <setting name="margin" value="0" />
+ <setting name="fontsize" value="11" />
+ <setting name="fontcolor" value="0xEEEEEE" />
+ <setting name="buttoncolor" value="0xEEEEEE" />
+ </settings>
+
+ <layout>
+ <group position="left">
+ <button name="play" />
+ <text name="elapsed" />
+ </group>
+ <group position="center">
+ <slider name="time" />
+ </group>
+ <group position="right">
+ <text name="duration" />
+ <button name="blank" />
+ <button name="mute" />
+ <button name="fullscreen" />
+ </group>
+ </layout>
+
+ <elements>
+ <element name="background" src="background.png" />
+ <element name="capLeft" src="divider.png" />
+ <element name="capRight" src="divider.png" />
+ <element name="divider" src="divider.png" />
+ <element name="blankButton" src="blankButton.png" />
+ <element name="fullscreenButton" src="fullscreenButton.png" />
+ <element name="fullscreenButtonOver" src="fullscreenButtonOver.png" />
+ <element name="muteButton" src="muteButton.png" />
+ <element name="muteButtonOver" src="muteButtonOver.png" />
+ <element name="pauseButton" src="pauseButton.png" />
+ <element name="pauseButtonOver" src="pauseButtonOver.png" />
+ <element name="playButton" src="playButton.png" />
+ <element name="playButtonOver" src="playButtonOver.png" />
+ <element name="timeSliderBuffer" src="timeSliderBuffer.png" />
+ <element name="timeSliderCapLeft" src="timeSliderCapLeft.png" />
+ <element name="timeSliderCapRight" src="timeSliderCapRight.png" />
+ <element name="timeSliderProgress" src="timeSliderProgress.png" />
+ <element name="timeSliderRail" src="timeSliderRail.png" />
+ <element name="normalscreenButton" src="normalscreenButton.png" />
+ <element name="normalscreenButtonOver" src="normalscreenButtonOver.png" />
+ <element name="unmuteButton" src="unmuteButton.png" />
+ <element name="unmuteButtonOver" src="unmuteButtonOver.png" />
+ <element name="volumeSliderRail" src="divider.png" />
+ <element name="volumeSliderProgress" src="divider.png" />
+ </elements>
+ </component>
+
+ <component name="display">
+ <settings>
+ <setting name="bufferinterval" value="250" />
+ <setting name="bufferrotation" value="90" />
+ </settings>
+ <elements>
+ <element name="background" src="background.png" />
+ <element name="playIcon" src="playIcon.png" />
+ <element name="muteIcon" src="muteIcon.png" />
+ <element name="errorIcon" src="bufferIcon.png" />
+ <element name="bufferIcon" src="bufferIcon.png" />
+ </elements>
+ </component>
+
+ <component name="dock">
+ <settings>
+ <setting name="fontcolor" value="0xFFFFFF" />
+ </settings>
+ <elements>
+ <element name="button" src="button.png" />
+ </elements>
+ </component>
+
+ <component name="playlist">
+ <settings>
+ <setting name="fontcolor" value="0xEEEEEE" />
+ <setting name="overcolor" value="0xFFFFFF" />
+ <setting name="activecolor" value="0xFFFFFF" />
+ <setting name="backgroundcolor" value="0x333333" />
+ </settings>
+ <elements>
+ <element name="item" src="item.png" />
+ <element name="itemOver" src="itemOver.png" />
+ <element name="sliderCapBottom" src="sliderCapBottom.png" />
+ <element name="sliderCapTop" src="sliderCapTop.png" />
+ <element name="sliderRail" src="sliderRail.png" />
+ <element name="sliderThumb" src="sliderThumb.png" />
+ </elements>
+ </component>
+
+ <component name="sharing">
+ <elements>
+ <element name="embedIcon" src="embedIcon.png" />
+ <element name="embedScreen" src="embedScreen.png" />
+ <element name="shareIcon" src="shareIcon.png" />
+ <element name="shareScreen" src="shareScreen.png" />
+ </elements>
+ </component>
+
+ </components>
+
</skin>
View
16 Gemfile.lock
@@ -13,10 +13,10 @@ GEM
fssm (>= 0.2.7)
sass (~> 3.1)
directory_watcher (1.4.1)
- fast-stemmer (1.0.0)
+ fast-stemmer (1.0.1)
ffi (1.0.11)
- fssm (0.2.8.1)
- haml (3.1.4)
+ fssm (0.2.9)
+ haml (3.1.6)
jekyll (0.11.0)
albino (>= 1.3.2)
classifier (>= 1.3.1)
@@ -24,26 +24,26 @@ GEM
kramdown (>= 0.13.2)
liquid (>= 1.9.0)
maruku (>= 0.5.9)
- kramdown (0.13.5)
+ kramdown (0.13.6)
liquid (2.2.2)
maruku (0.6.0)
syntax (>= 1.0.0)
posix-spawn (0.3.6)
- pygments.rb (0.2.7)
+ pygments.rb (0.2.12)
rubypython (~> 0.5.3)
rack (1.4.1)
rake (0.9.2.2)
- rb-fsevent (0.9.0)
+ rb-fsevent (0.9.1)
rdiscount (1.6.8)
rubypants (0.2.0)
rubypython (0.5.3)
blankslate (>= 2.1.2.3)
ffi (~> 1.0.7)
- sass (3.1.15)
+ sass (3.1.18)
sinatra (1.2.6)
rack (~> 1.1)
tilt (>= 1.2.2, < 2.0)
- stringex (1.3.2)
+ stringex (1.4.0)
syntax (1.0.0)
tilt (1.3.3)
View
2  README.markdown
@@ -16,7 +16,7 @@ Check out [Octopress.org](http://octopress.org/docs) for guides and documentatio
## Contributing
-We love to see people contributing to Octopress, whether it's a bug report, feature suggestion or a pull request. At the moment, we try to keep the core slick and lean, focusing on basic blogging needs, so some of your suggestions might not find their way into Octopress. For those ideas, we started a [list of 3rd party plug-ins](https://github.com/imathis/octopress/wiki/3rd-party-plug-ins), where you can link your own Octopress plug-in repositories. For the future, we're thinking about ways to easier add them them into our main releases.
+We love to see people contributing to Octopress, whether it's a bug report, feature suggestion or a pull request. At the moment, we try to keep the core slick and lean, focusing on basic blogging needs, so some of your suggestions might not find their way into Octopress. For those ideas, we started a [list of 3rd party plug-ins](https://github.com/imathis/octopress/wiki/3rd-party-plugins), where you can link your own Octopress plug-in repositories. For the future, we're thinking about ways to easier add them them into our main releases.
## License
View
8 plugins/octopress_filters.rb
@@ -24,10 +24,14 @@ module Jekyll
class ContentFilters < PostFilter
include OctopressFilters
def pre_render(post)
- post.content = pre_filter(post.content)
+ if post.ext.match('html|textile|markdown|haml|slim|xml')
+ post.content = pre_filter(post.content)
+ end
end
def post_render(post)
- post.content = post_filter(post.content)
+ if post.ext.match('html|textile|markdown|haml|slim|xml')
+ post.content = post_filter(post.content)
+ end
end
end
end
View
11 source/_posts/2012-05-16-electronic-music-is-good-for-coding.markdown
@@ -0,0 +1,11 @@
+---
+layout: post
+title: "Electronic Music Is Good for Coding"
+date: 2012-05-16 09:31
+comments: true
+categories: blog, meta, music
+---
+
+I've recently been curating a playlist on spotify for [High Energy Electronic Music](http://spoti.fi/IYBsOd) so that I could have something high energy with no lyrics, or at the very least very simple ones that were easy to ignore. The big point was to have something high energy that got me into the coding groove.
+
+I have to say that it's worked. Having a driving beat and some hard hits has made it really easy to get motivated to code on. Suggestions for similar artists/songs welcome.
View
122 source/_posts/2012-05-22-dci-generators-in-rails.markdown
@@ -0,0 +1,122 @@
+---
+layout: post
+title: "DCI Generators in Rails"
+date: 2012-05-22 12:10
+comments: true
+categories: dci, rails, blog
+---
+
+Recently, in my new project, I decided to take the [DCI](http://en.wikipedia.org/wiki/Data,_context_and_interaction) approach that [Mike Pack outlined](http://mikepackdev.com/blog_posts/24-the-right-way-to-code-dci-in-ruby), which has been really cool. I've been able to keep my tests fast, and have very distinct buckets to put data (models), specific roles of that data (rather than cluttering up the models), and an easy way to take a use case and map it out programatically (contexts).
+
+I noticed that I was generating roles and contexts regularly and copying from previously written code examples so I decided to make role and context generators. The process wasn't bad, but it did take a couple of steps that took a little digging to understand.
+
+My Role generator pretty much just generates this:
+``` ruby my_role.rb
+module MyRole
+end
+```
+
+But it also hooks into RSpec and generates this
+``` ruby my_role_spec.rb
+require 'fast_spec_helper'
+require 'staffing_professional'
+
+class TestMyRole; end
+
+describe MyRole do
+ let(:subject) {
+ s = TestMyRole.new
+ s.extend MyRole
+ }
+ pending "add some specs to my_role_spec.rb"
+end
+```
+
+The generator itself is pretty easy to setup... Rails even has a generator for making a generator!
+
+``` bash
+$ rails g generator role
+ create lib/generators/role
+ create lib/generators/role/roles_generator.rb
+ create lib/generators/role/USAGE
+ create lib/generators/role/templates
+```
+
+The important file there is <code>roles_generator.rb</code>
+
+``` ruby roles_generator.rb
+class RoleGenerator < Rails::Generators::NamedBase
+ source_root File.expand_path('../templates', __FILE__)
+end
+```
+
+What's going on here? Well, the digging came in for Rails::Generators::NamedBase, which provides a bunch of fun little helpers like <code>file_name</code>, <code>class_name</code>, <code>singular_name</code>, <code>plural_name</code> etc -- and this is exactly what you want when you're making a generator for something like Roles or Contexts.
+
+So I expanded the roles_generator:
+``` ruby rails_generator.rb
+class RoleGenerator < Rails::Generators::NamedBase
+ source_root File.expand_path('../templates', __FILE__)
+
+ def generate_role
+ empty_directory 'app/roles'
+ template 'role.rb', File.join('app/roles', class_path, "#{file_name}.rb")
+ end
+
+ hook_for :test_framework
+end
+```
+
+It doesn't matter what you call the method... every public method gets called. I don't even want to know the horrid magic that had to go on to make that happen just the way they wanted it to. There are a bunch of fun helpers you can call like <code>copy_file</code>, <code>exists_dir</code>, and <code>template</code> which give you most of what you need. Lots of other help is available in the [<code>Thor::Actions</code> docs](http://textmate.rubyforge.org/thor/Thor/Actions.html)
+
+It was pretty easy to set up the templates at that point.
+
+``` ruby templates/role.rb
+module <%= class_name %>
+end
+```
+
+You'll also notice the little <code>hook_for :test_framework</code> line at the bottom of the generator. That enables you to tie into whatever test framework you've configured, which means this could be easily packaged up as a gem with support for both <code>Rspec</code> and <code>Test::Unit</code> depending on what you wanted to use.
+
+Adding the support for Rspec was pretty easy, but you're tapping into rspecs generators if you want to do it right, not just copying files willy nilly within your own generator.
+
+I added a directory called <code>lib/generators/rspec</code> that included <code>roles_generator.rb</code> and a templates directory
+
+The generator looks like this:
+``` ruby rspec/roles_generator.rb
+module Rspec
+ # Generates a spec file for the role module
+ class RoleGenerator < ::Rails::Generators::NamedBase
+ source_root File.expand_path('../templates', __FILE__)
+
+ def build_role_specs
+ empty_directory 'spec/roles'
+ template 'role_spec.rb', "spec/roles/#{singular_name}_spec.rb"
+ end
+ end
+end
+```
+
+Only thing to note here is the <code>module Rspec</code> that wraps the whole class. Without this, Rspec won't pick up the generator.
+
+Then make your spec template
+
+``` ruby rspec/templates/role_spec.rb
+require 'fast_spec_helper'
+require '<%= singular_name %>'
+
+<%= "class Test#{class_name}; end" %>
+
+describe <%= class_name %> do
+ let(:subject) {
+ s = Test<%= class_name %>.new
+ s.extend <%= class_name %>
+ }
+ pending "add some tests to the <%= file_name %>_spec.rb"
+end
+```
+
+Since it's a module, we set up a test class that is automatically extended as <code>subject</code> since any other use of <code>subject</code> doesn't make sense.
+
+Easy cheesy!
+
+Now I just need to extract these generators to a <code>dci_generators</code> gem :)

No commit comments for this range

Something went wrong with that request. Please try again.