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
| l = 4 | |
| r = 10 | |
| answer = l + r | |
| puts "answer is more than 6" if answer > 6 | |
| puts answer |
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 is a test gist. |
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 'rubygems' | |
| require 'appscript' | |
| require 'yaml' | |
| module BigType | |
| extend Appscript | |
| def self.show(display_me) | |
| app("Quicksilver").show_large_type(display_me) |
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
| #import "GTMSenTestCase.h" | |
| @interface «FILEBASENAMEASIDENTIFIER» : GTMTestCase { | |
| } | |
| @end | |
| @implementation «FILEBASENAMEASIDENTIFIER» |
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
| #import "RecordingUploader.h" | |
| #import "RestConfiguration.h" | |
| @implementation RecordingUploader | |
| -(void)uploadFile:(NSString*)file{ | |
| NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"http://%@:%d/recordings", [RestConfiguration host], [RestConfiguration port]]]; | |
| NSData *data = [NSData dataWithContentsOfFile:file]; |
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 el=window.frames[1].document.msgViewer.elements; | |
| for (var i=0; i <el.length; i++){el[i].checked=true;} |
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
| Screw.Matchers["be_visible"] = { | |
| match: function(expected, actual) { | |
| return actual.css('display') != "none" | |
| }, | |
| failure_message: function(expected, actual, not) { | |
| return 'expected ' + $.print(actual) + (not ? ' not' : '') + ' to be 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
| # from http://broadcast.oreilly.com/2008/10/testing-rails-partials.html | |
| class ApplicationController | |
| def _renderizer; render params[:args]; end | |
| end | |
| class ActionController::TestCase # or Test::Unit::TestCase, for Rails <2.0 | |
| def render(args); get :_renderizer, :args => args; end | |
| 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
| function bind_label_hiding(){ | |
| $("div.feedback_row label").each(function(index, item){ | |
| var field = $("#" + $(item).attr("for")); | |
| field.bind("focus", function(){ | |
| $(item).hide(); | |
| }); | |
| field.bind("blur", function(){ | |
| if (jQuery.trim(field.attr("value")) == "") $(item).show(); | |
| }); |
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 submit_form_javascript name, path, form_name | |
| submission_js = remote_function(:form=>true, | |
| :loading => visual_effect(:appear, 'spinner'), | |
| :complete => visual_effect(:fade, 'spinner', :duration => 0), | |
| :url=>path, | |
| :html=>{:id=>form_name, | |
| :method=>:get}) | |
| submission_js.gsub! 'this', "'##{form_name}'" | |
| javascript_tag "#{name} = function() {#{submission_js}}" | |
| end |
OlderNewer