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 'formula' | |
class Dpkg <Formula | |
url 'https://launchpad.net/debian/+archive/primary/+files/dpkg_1.16.0.3.tar.bz2' | |
homepage 'http://en.wikipedia.org/wiki/Dpkg' | |
md5 '0266b06ef9da8278cea008d21e17e5f6' | |
depends_on 'gnu-tar' | |
# depends_on 'cmake' |
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 'formula' | |
class Dpkg <Formula | |
url 'https://launchpad.net/debian/+archive/primary/+files/dpkg_1.16.0.3.tar.bz2' | |
homepage 'http://en.wikipedia.org/wiki/Dpkg' | |
md5 '0266b06ef9da8278cea008d21e17e5f6' | |
depends_on 'gnu-tar' | |
def patches |
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
diff --git a/app/controllers/reporting.rb b/app/controllers/reporting.rb | |
index 3a6768f..662bdd9 100644 | |
--- a/app/controllers/reporting.rb | |
+++ b/app/controllers/reporting.rb | |
@@ -24,34 +24,6 @@ class Reporting < Application | |
if instance.status == :running | |
Merb.logger.error! "instance(#{instance.amazon_id}) ALERT!\n SEVERITY: #{params[:data]['Severity']}\n PLUGIN:#{params[:data]['Plugin']} TYPE:#{params[:data]['Type']}\n MESSAGE:#{params[:data]['alert_message']}" | |
Alert.create_from_json(instance, params['data']) | |
- environment = Environment.get instance.environment.id | |
- if environment.alerting_enabled |
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
# run very flat apps with merb -I <app file>. | |
# use_orm :datamapper | |
use_test :rspec | |
require 'haml' | |
require 'compass' | |
Merb::Config.use { |c| | |
c[:framework] = { :public => [Merb.root / "public", nil] } | |
c[:session_store] = 'none' | |
c[:exception_details] = true |
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 show(id) | |
@post = Post.get(id) | |
raise NotFound unless @post | |
display @post | |
end | |
def create(comment) | |
@comment = Comment.new(comment) | |
if @comment.save | |
eager_cache([Posts, :show], :store => :action_store) { self.class.build_request(url(:post, @comment.post), :id => @comment.post.id) } |
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
declare -a pids | |
i=0 | |
for pid in log/merb.*.pid ; do | |
if [ $pid == "log/merb.main.pid" ]; then | |
echo "Killing master process" | |
kill -9 `cat $pid` | |
else | |
pids[$i]=`cat $pid` | |
fi |
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 Pais | |
include DataMapper::Resource | |
# Configuración de las relaciones | |
has n, :bancos | |
# Propiedades principales | |
property :id, Serial | |
property :nombre, String, :length => (1..50), :nullable => false | |
property :nombre_corto, String, :length => (1..20), :nullable => false |
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
# current code: | |
unless @users = cache_get("active_users") | |
@users = User.all(:active => true) | |
cache_set("active_users", @users) | |
# object caching can be used to avoid pulling huge amounts of data | |
# from the database. | |
# you could have calle cache_set with an expiration time as well: | |
# cache_set("active_users", @users, 10) | |
end |