If one was inclined to use the acts_as_yaffle pattern, they would probably use the second one, rather than the heavily cargo-culted first one.
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
| # checkout: http://github.com/igrigorik/async-rails/ | |
| From bb2a78858cffa7c6937642986e9aca1a4f862c0d Mon Sep 17 00:00:00 2001 | |
| From: Ilya Grigorik <ilya@igvita.com> | |
| Date: Thu, 10 Jun 2010 00:46:48 -0400 | |
| Subject: [PATCH] async rails3 | |
| --- | |
| Gemfile | 6 ++++++ | |
| app/controllers/widgets_controller.rb | 6 ++++++ |
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 is an example of using RVM's Project .rvmrc file | |
| to have it automatically bootstrap your environment, including bundler. | |
| This could be further expanded to do anything you require :) | |
| The important thing to remember is that the purpose of these files is | |
| to allow you to very easily have your 'project context' (aka 'environment') | |
| loaded automatically for you when you enter the project in the shell (cd). | |
| You can generate the .rvmrc file below by running: |
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
| /* | |
| * twitter-entities.js | |
| * This function converts a tweet with "entity" metadata | |
| * from plain text to linkified HTML. | |
| * | |
| * See the documentation here: http://dev.twitter.com/pages/tweet_entities | |
| * Basically, add ?include_entities=true to your timeline call | |
| * | |
| * Copyright 2010, Wade Simmons | |
| * Licensed under the MIT license |
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 pbcopy(string) | |
| pasteBoard = NSPasteboard.generalPasteboard | |
| pasteBoard.declareTypes([NSStringPboardType], owner: nil) | |
| pasteBoard.setString(string, forType: NSStringPboardType) | |
| 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
| module AccessibleBlock | |
| module ClassMethods | |
| @accessible_block = false | |
| def key(*arguments, &block) | |
| super | |
| attr_accessible arguments[0] if @accessible_block | |
| end | |
| def attr_accessible(*attrs) | |
| if block_given? |
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
| # sh function to murder all running processes matching a pattern | |
| # thanks 3n: http://twitter.com/3n/status/19113206105 | |
| murder () { | |
| ps | grep $1 | grep -v grep | awk '{print $1}' | xargs kill -9 | |
| } |
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
| start on runlevel [2345] | |
| stop on runlevel [06] | |
| chdir /var/app/current | |
| exec run_bundle unicorn -c config/unicorn.rb -E production | |
| post-start script | |
| sleep 5 | |
| rm -f /var/app/shared/system/maintenance.html | |
| end 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
| require 'nokogiri' | |
| require 'highline/import' | |
| require 'instapush' | |
| pinboard_username = ask("Enter your Pinboard username: ") { |q| q.echo = true } | |
| pinboard_password = ask("Enter your Pinboard password: ") { |q| q.echo = "*" } | |
| bookmarks = `wget http://#{pinboard_username}:#{pinboard_password}@pinboard.in/export/` | |
| instapaper_username = ask("Enter your Instapaper username: ") { |q| q.echo = true } |