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 Object | |
def method_missing(name, *args, &block) | |
# noop | |
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
- (@action)reltypeClick:(id)sender | |
{ | |
var button; | |
var direction; | |
switch ([sender tag]) { | |
case 1: | |
direction = reltypeaDirBA; | |
button = reltypeaDirToggle; | |
break; |
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/ruby | |
max = 100 | |
sum = (0..max).inject { |s,n| s + n**2 } | |
sqr = ((0..max).inject { |s,n| s+n }) ** 2 | |
puts sqr-sum | |
###### Alternate solution : | |
#!/usr/bin/ruby |
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
else | |
new_config = BOT_CONFIG | |
new_config[:autoload_plugins] = args | |
@bot.write_configuration(new_config) | |
# In lieu of reloading the configuration file, just redefine the constant | |
Kernel.remove_const(:BOT_CONFIG) if Kernel.const_defined?(:BOT_CONFIG) | |
Kernel.const_set(:BOT_CONFIG, new_config) | |
msg nick, "new configuration saved." | |
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
Use cases for mod to RuBot | |
1: The bot starts with no :autoload_plugins: entry in the yaml config file: a blank entry should be added | |
2: :autoload_plugins: is empty. The only plugin that should be loaded when the connection is established is core | |
3: :autoload_plugins: has multiple space-delimited module names. All are loaded when the connection is established. | |
4: :autoload_plugins: has multiple space-delimited module names. An invalid module name is in the list. All valid modules are loaded when the connection is established. Invalid modules produce a warning on the console, but do not raise. | |
5: The bot starts with no :autojoin_rooms: entry in the yaml config file: a blank entry should be added | |
6: :autojoin_rooms: is empty. No rooms are joined when the bot connection is established. | |
7: :autojoin_rooms: has multiple space-delimited #room names. All are joined when the connection is established. |
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 | |
basedir=/tmp/testscript/working/Images | |
pushd "$basedir" &>/dev/null | |
# Loop over all dirs with names in front | |
for dirname in $(find ./apteryx -maxdepth 1 -type d -iregex '\./[a-z].*') | |
do | |
patnum=$(echo $dirname | sed 's/^.*_\([0-9]\+\)/\1/') | |
if grep -qv '^[[:digit:]]\+$' <<<$patnum |
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 | |
# This script is named jpgtest_setup.sh | |
rm -rf /tmp/testscript | |
function setup | |
{ | |
mkdir -p "$(dirname "$1")" | |
touch "$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
class ProcedureDefinition < ActiveRecord::Base | |
validates :name, :presence => true | |
validates :version, :presence => true | |
before_destroy :check_is_latest_version |
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 | |
# 05/26/2012 jag | |
# COMPONENT_NAME: backup_prep.sh | |
# | |
# ORIGIN: Jeffrey Gipson | |
# | |
# Personal Proprietary | |
# (C) COPYRIGHT 2012 Jeffrey Gipson | |
# Unpublished work - All Rights Reserved | |
# |
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 | |
# Usage: rotate-screen [absolute] [action] | |
# | |
# ACTIONS: | |
# flip|invert - invert the screen from the current rotation | |
# left - rotate to the left | |
# right - rotate to the right | |
# | |
# OPTION: |
OlderNewer