Skip to content

Instantly share code, notes, and snippets.

View wfarr's full-sized avatar
:shipit:
shipping

Will Farrington wfarr

:shipit:
shipping
View GitHub Profile
- (@posts.reverse)[0..10].each do |post|
%a{:href => "view/#{post.id}-#{post.slug}", :title => "#{post.title}" }
%h3= post.title
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
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
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}
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})
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
#!/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
[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 :)
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}
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}