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
| - (@posts.reverse)[0..10].each do |post| | |
| %a{:href => "view/#{post.id}-#{post.slug}", :title => "#{post.title}" } | |
| %h3= post.title |
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 Merb | |
| module PostsHelper | |
| def generate_post_link(post) | |
| "posts/view/#{post.id}-#{post.slug}" | |
| end | |
| def generate_post_date(post) | |
| "Posted #{print_date(post.created_at)}" | |
| 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
| class Post | |
| include DataMapper::Resource | |
| property :id, Serial | |
| property :title, String | |
| property :content, Text | |
| property :tags, String | |
| property :slug, String | |
| property :created_at, DateTime | |
| property :updated_at, DateTime |
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 'hotcocoa' | |
| include HotCocoa | |
| application do |app| | |
| window :size => [200, 100] do |win| | |
| win.view = layout_view :mode => :vertical do |layout| | |
| layout.spacing = 10 | |
| b = button :title => "click me", :layout => {:align => :center} | |
| l = label :text => "", :layout => {:align => :center} |
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 'hotcocoa' | |
| include HotCocoa | |
| application do |app| | |
| window :size => [200, 100] do |win| | |
| win.view = layout_view :mode => :vertical do |layout| | |
| layout.spacing = 10 | |
| btn = button(:title => "click me", :layout => {:align => :center}) | |
| lbl = label(:text => "text", :layout => {:align => :center}) |
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
| wfarr@lawn-128-61-22-6:~$ echo "some data" > data.txt | |
| wfarr@lawn-128-61-22-6:~$ ln -s data.txt slink.txt | |
| wfarr@lawn-128-61-22-6:~$ cat slink.txt | |
| some data |
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
| #!/bin/sh | |
| mkdir ln_test && cd ln_test/ | |
| echo "Some test" > test_file | |
| echo "Make sure test_file exists" | |
| echo "" | |
| exist=`ls -ali | grep test_file` | |
| if [ "$exist" != "" ]; then |
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
| [20:56] <offby1> I suspect math is the _only_ field for which LaTeX really | |
| makes sense | |
| [20:56] <wfarr> offby1: I use it to write my notes and any papers as well. | |
| [20:56] <offby1> wfarr: well, sure, but I use Emacs to read mail: some | |
| people are insane :) |
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 'hotcocoa' | |
| include HotCocoa | |
| application do |app| | |
| window :size => [200, 100] do |win| | |
| win.view = layout_view :mode => :vertical do |layout| | |
| layout.spacing = 10 | |
| btn = button :title => "click me", :layout => {:align => :center} | |
| lbl = label :text => "text", :layout => {:align => :center} |
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 'hotcocoa' | |
| include HotCocoa | |
| application do |app| | |
| window :size => [200, 100] do |win| | |
| win.view = layout_view :mode => :vertical do |layout| | |
| layout.spacing = 10 | |
| btn = button :title => "click me", :layout => {:align => :center} | |
| lbl = label :text => "text", :layout => {:align => :center} |