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
<article> | |
<h2>archive</h2> | |
<% years = [] %> | |
<% @articles.select.each {|a| years.push(a[:date].year)} %> | |
<% years.uniq!.each do |year| %> | |
<div class="archive-section"> | |
<h3><%= year %></h3> | |
<ul> | |
<% @articles.select {|a| a[:date].year == year && a[:date] <= Date.today}.each do |article| %> | |
<li> |
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
<script type="text/javascript"> | |
$(document).ready(function(){ | |
$('.gistinclude').each(function(){ | |
var gistLocation = $(this); | |
$.getJSON('http://gist.github.com/'+$(this).attr('data-gistid')+'.json?callback=?', function(data){ | |
gistLocation.replaceWith(data.div); | |
}); | |
}); | |
}); | |
</script> |
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
<p class="gistinclude" data-gistid="580160"></p> |
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
/System/Library/CoreServices/Menu\ Extras/User.menu/Contents/Resources/CGSession -suspend |
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
cat 'work in progress' |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset=utf-8 /> | |
<title>Border Image Test</title> | |
<style type="text/css"> | |
#slider { | |
/*This shows how to use border-image to mimic the behavior | |
of stretchableImageWithLeftCapWidth:topCapHeight: in CSS. | |
This example has a border-left and border-right width of 15px. |
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
def cocktailsort(array) | |
arr = Array.new(array) | |
swapped = true | |
while swapped do | |
swapped = false | |
for i in 0.upto(arr.length-2) do | |
if arr[i] > arr[i+1] then | |
arr[i], arr[i+1] = arr[i+1], arr[i] | |
swapped = true | |
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
def archives filter = "", tag = nil | |
entries = ! self.articles.empty?? | |
self.articles.select do |a| | |
filter !~ /^\d{4}/ || File.basename(a) =~ /^#{filter}/ | |
end.reverse.map do |article| | |
Article.new article, @config | |
end : [] | |
if tag.nil? | |
{ :archives => Archives.new(entries, @config) } |
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
def go route, env = {}, type = :html | |
# ... | |
elsif route.first == 'tag' && route.size == 2 | |
if (data = archives('', route[1])).nil? | |
http 404 | |
else | |
context[data, :tag] | |
end |
OlderNewer