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
pconsole () { | |
if [[ -e ./config/environment.rb ]]; | |
then | |
rails_env="development" | |
if [[ "$1z" != "z" ]]; then rails_env=$1; fi; | |
RAILS_ENV=$rails_env pry -r ./config/environment.rb -r rails/console/app -r rails/console/helpers; | |
else pry; | |
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
#!/usr/bin/env ruby | |
require 'tk' | |
require 'tkextlib/tile' | |
require 'tkextlib/bwidget' | |
require 'cups' | |
$dirname = TkVariable.new | |
root = TkRoot.new {title "Print Folder"} |
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 hour_intervals(start_time, stop_time) | |
results = Hash.new {|h,k| h[k] = Hash.new(0)} | |
(start_time.to_i..stop_time.to_i).step(60).collect do |minute| | |
minute_time = Time.at(minute) | |
interval = case minute_time.min | |
when (0..14) then 0 | |
when (15..29) then 15 | |
when (30..44) then 30 | |
when (45..59) then 45 |
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
set project_directory to do shell script "find ~/ ~/Source ~/Source/ruby ~/Source/ruby/webapps -maxdepth 1 -type d -name " & q & " | head -1" | |
on pathexists(path) | |
try | |
path as alias | |
return true | |
on error | |
return false | |
end try | |
end pathexists |
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 TestConnection | |
def repeat_test | |
while true do | |
if packet_loss > 0 | |
`say 'link down'` | |
end | |
end | |
end | |
def packet_loss |
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/lib/spring/application.rb b/lib/spring/application.rb | |
index 6e241a8..69ef383 100644 | |
--- a/lib/spring/application.rb | |
+++ b/lib/spring/application.rb | |
@@ -22,9 +22,6 @@ module Spring | |
@stdout = IO.new(STDOUT.fileno) | |
@stderr = IO.new(STDERR.fileno) | |
- @stdin = File.open('/dev/null', 'r') | |
- |
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 'routes' # from routes.rb file below | |
class CreateRouteTests | |
def initialize(routes_file) | |
self.routes = ROUTES | |
end | |
def routes | |
@routes ||= ROUTES | |
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
def visible?(klass, name) | |
(klass.public_instance_methods + klass.public_class_methods).any? { |m| m.to_s == name } | |
end | |
private :visible? |
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 'rspec/autorun' | |
class Person | |
attr_accessor :first_name, :last_name, :gender | |
def full_name | |
"#{first_name} #{last_name}" | |
end | |
def self.average_age |
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
var Component = Ember.Component.extend({ | |
classNameBindings: [":title", "isFeatured::singlestat"], | |
valueListenerShouldGenerate: false, | |
isFeatured: false, | |
init: function() { | |
var statPoint = this, | |
statId = statPoint.get("stat.id"); | |
this.statDidChange(); |
OlderNewer