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
#!/usr/bin/ruby -W0 | |
=begin | |
Quick and dirty way to tweet the currently active | |
Safari tab (title + shortened URL). Hashtags get | |
passed in as parameters (the hash sign gets added | |
by the script, so don't do it yourself). | |
Adapt to your needs! | |
=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
# The simplest thing that could possibly work. | |
class Attachment < ActiveRecord::Base | |
before_create :store_metadata | |
after_create :store_file | |
# Virtual attribute that stores the uploaded tempfile | |
attr_accessor :uploaded_file | |
private | |
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
Let's make a list of Sinatra-based apps! | |
Apps: | |
- http://github.com/cschneid/irclogger "Sinatra based irclogger.com" | |
- http://github.com/rtomayko/wink "minimalist blogging engine" | |
- http://github.com/foca/integrity "The easy and fun Continuous Integration server" | |
- http://github.com/sr/git-wiki "git-powered wiki" | |
- http://github.com/entp/seinfeld "Seinfeld-inspired productivity calendar to track your public github commits." | |
- http://github.com/karmi/marley "Marley, the blog engine without <textareas>." | |
- http://github.com/ichverstehe/gaze "Serve up your Markdown files with this tiny Sinatra app!" |
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
# This program is free software: you can redistribute it and/or modify | |
# it under the terms of the GNU Affero General Public License as published by | |
# the Free Software Foundation, either version 3 of the License, or | |
# (at your option) any later version. | |
# | |
# This program is distributed in the hope that it will be useful, | |
# but WITHOUT ANY WARRANTY; without even the implied warranty of | |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
# GNU Affero General Public License for more details. | |
# |
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
# iniziamo creando una nuova applicazione Rails | |
rails silly_blog | |
cd silly_blog | |
# portiamola sotto version control con Git | |
git init | |
git add . | |
git commit -a -m "first commit" | |
# siamo nel "master" branch |
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
# Generations | |
%w( | |
rubygems dm-core | |
haml dm-aggregates | |
sinatra dm-is-paginated | |
uv dm-is-slugged | |
ostruct dm-tags | |
).each {|n| require(n)} | |
configure 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
Shoes.app(:title => "MGang Clock v0.01", :width => 320, :height => 320, :resizable => true) do | |
background "#234".."#c03", :angle => 45 | |
deg_increment = Math::PI / 4 | |
@imgs = [] | |
@style_over = { :width => 100, :height => 100 } | |
@style_out = { :width => 20, :height => 20} | |