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/sh | |
# Simple script for checking network availability every 5 minutes | |
while true; do | |
ping -c 1 www.google.com &> /dev/null | |
echo "$? `date`" | tee -a ~/output.txt | |
sleep 300 | |
done |
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
# code source: https://github.com/thoughtbot/shoulda/issues/174 | |
RSpec::Matchers.define :delegate do |delegated_method| | |
chain :to do |target_method| | |
@target_method = target_method | |
end | |
chain :as do |method_on_target| | |
@method_on_target = method_on_target | |
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
# This file is in lib | |
module AutoStripTextAttributes | |
extend ActiveSupport::Concern | |
included do | |
text_columns = columns.collect do |c| | |
c.name.to_sym if c.type == :string || c.type == :text | |
end.compact |
NewerOlder