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/env ruby | |
require 'ipaddr' | |
module Brainwash | |
module Help | |
extend self | |
def examples | |
<<-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
#!/bin/bash | |
if [ "$#" -ne 2 ] | |
then | |
echo "Usage: leader portnumber command" | |
exit 1 | |
fi | |
first_run=1 | |
while : |
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
testar |
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 Forego < ScriptFileFormula | |
homepage 'https://github.com/ddollar/forego' | |
url 'https://godist.herokuapp.com/projects/ddollar/forego/releases/0.8.2/darwin-amd64/forego' | |
sha1 '62f4c0cb7e48647ca7c9ef4a801f49576b577d4a' | |
version '0.8.2' | |
test do | |
system "#{bin}/forego", "version" |
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
================================================================================ | |
Recipe Compile Error in /var/chef/cache/cookbooks/sensu/libraries/json_file.rb | |
================================================================================ | |
NoMethodError | |
------------- | |
undefined method `attribute' for Chef::Resource::JsonFile:Class | |
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/env ruby | |
# | |
# Copy this file into .git/hooks and chmod +x | |
# | |
branchname = `git branch --no-color 2> /dev/null`[/^\* (.+)/, 1].to_s | |
PIVOTAL_REFERENCE = /s-(\d+)/i | |
if story_match = branchname.match(PIVOTAL_REFERENCE) | |
story_id = story_match.captures.first | |
reference = "[#%s]" % story_id | |
`echo "#{reference}"|cat - #{ARGV[0]} > /tmp/out && mv /tmp/out #{ARGV[0]}` |
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 AttachedFile < ActiveRecord::Base | |
belongs_to :parent, :polymorphic => true | |
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 AttachedFile < ActiveRecord::Base | |
belongs_to :parent, :polymorphic => true | |
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 ShoppingCartWidget < Apotomo::Widget | |
include Devise::Controllers::Helpers | |
helper ApplicationHelper | |
after_add do |me, parent| | |
me.root.respond_to_event :item_removed, :with => :redraw, :on => me.name | |
end | |
has_widgets do |me| | |
@user = User.find(param(:user)) |
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 Product | |
include Mongoid::Document | |
field :name | |
embeds_many :product_items | |
has_many_related :articles | |
def update_product_items | |
product_items.destroy_all | |
articles.all.each do |a| |
NewerOlder