This file contains 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
namespace :deploy do | |
def config(key) | |
(@config ||= YAML.load_file("config/deploy.yml").symbolize_keys)[key.to_sym] | |
end | |
# Hooks as needed | |
task :local_before do | |
end |
This file contains 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
=begin | |
http://groups.google.com/group/capistrano/msg/9f17c9c7787ac390 | |
Message from discussion deploy:check and config.gem | |
From: Tom Copeland <[email protected]> | |
Date: Thu, 4 Feb 2010 06:57:50 -0500 | |
Local: Thurs, Feb 4 2010 3:57 am | |
Subject: Re: [capistrano] deploy:check and config.gem | |
On Feb 4, 2010, at 6:39 AM, Tom Copeland wrote: |
This file contains 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
# Instance methods can only access class-level instance variables via accessor methods (which are themselves class-level methods). | |
# Here's a demonstration of a more complex situation (in which the instance method in question comes from a mix-in module) | |
# that illustrates the same principle. | |
module M | |
def f | |
puts self.class.a | |
end | |
end |
This file contains 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 Parent | |
def initialize( a, b ) | |
@a = a | |
@b = b | |
end | |
attr_reader :a, :b | |
end | |
class Child < Parent | |
def initialize( *args ) |
This file contains 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
# In Ruby, initialize is not a class method; it can't access | |
# class instance variables. | |
class C | |
@a = 1 | |
def self.a | |
@a | |
end | |
def initialize |
This file contains 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 (( $# < 1 )) | |
then | |
script_name=`basename $0` | |
echo "Usage: $script_name <interface_name>" | |
echo " e.g.: $script_name `ifconfig -l -d | cut -f 1 -d ' '`" | |
exit | |
fi |
This file contains 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
tell application "System Preferences" | |
activate | |
set current pane to pane id "com.apple.preference.security" | |
tell application "System Events" | |
tell process "System Preferences" | |
-- UNLOCK CHECKS | |
if (exists checkbox "Click the lock to make changes." of window 1) is true then | |
click checkbox "Click the lock to make changes." of window 1 |
This file contains 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 | |
~/bin/toggle_Require_password_on_wake.app/Contents/MacOS/applet |
This file contains 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
# Tested under: | |
# $ ruby -v | |
# ruby 1.8.7 (2010-04-19 patchlevel 253) [i686-darwin10.4.0], MBARI 0x6770, Ruby Enterprise Edition 2010.02 | |
class C | |
def f | |
raise NotImplementedError | |
end | |
end |
This file contains 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 | |
arguments = [] | |
ARGV.each { |arg| | |
arguments << File.expand_path( arg ) | |
} | |
system( "java -cp /Applications/jEdit.app/Contents/Resources/Java/jedit.jar:/System/Library/Java -Dapple.awt.textantialiasing=true -Dapple.laf.useScreenMenuBar=true -Dapple.awt.antialiasing=true org.gjt.sp.jedit.jEdit -background #{arguments.join( ' ' )} &" ) |
OlderNewer