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
private string GetTemperatureViaSOAP11() { | |
var results = string.Empty; | |
var url = "http://ws.cdyne.com/WeatherWS/Weather.asmx"; | |
var ns = "http://ws.cdyne.com/WeatherWS/"; | |
var soap = "<?xml version=\"1.0\" encoding=\"utf-8\" ?>" | |
+ "<soap:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">" | |
+ " <soap:Body>" | |
+ " <GetCityWeatherByZIP xmlns=\"{1}\">" | |
+ " <ZIP>{0}</ZIP>" | |
+ " </GetCityWeatherByZIP>" |
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
private string GetTemperatureViaHTTPGET() { | |
var results = string.Empty; | |
var url = "http://ws.cdyne.com/WeatherWS/Weather.asmx/GetCityWeatherByZIP?ZIP=" + zipcode.Text; | |
using(var web = new WebClient()) | |
using(var stream = web.OpenRead(new Uri(url))) | |
using(var reader = new StreamReader(stream)) { | |
results = reader.ReadToEnd(); | |
} | |
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
using NHibernate; | |
using FluentNHibernate.Conventions.Helpers; | |
using FluentNHibernate.Cfg.Db; | |
using FluentNHibernate.Testing; | |
namespace your.namespace.Tests { | |
/// <summary> | |
/// Base class for integration tests. |
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
using System; | |
using System.Collections.Generic; | |
using System.IO; | |
using System.Linq; | |
using System.Web.Mvc; | |
using System.Web.Routing; | |
/* | |
* TODO: | |
* auto_discovery_link_tag |
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
<script type="text/javascript"> | |
jQuery(function($){ | |
$.fn.num = function(){ | |
var val = $(this).val(); | |
return (isNaN(val) || val == null) ? 0 : parseInt(val); | |
} | |
}); | |
</script> | |
<!-- usage --> |
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
# create fresh git repo | |
git :init | |
git :add => '.' | |
git :commit => '-a -m "fresh rails app"' | |
# include gems | |
gem 'rspec', '>= 2.0.0.beta.19', :group => :test | |
gem 'rspec-rails', '>= 2.0.0.beta.19', :group => :test | |
gem 'cucumber', '>= 0.8.5', :group => :test | |
gem 'cucumber-rails', '>= 0.3.2', :group => :test |
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
# Ruby Koans - Greed Game - scoring method | |
# from http://rubykoans.com http://edgecase.com | |
# * A set of three ones is 1000 points | |
# * A set of three numbers (other than ones) is worth 100 times the | |
# number. (e.g. three fives is 500 points). | |
# * A one (that is not part of a set of three) is worth 100 points. | |
# * A five (that is not part of a set of three) is worth 50 points. | |
# * Everything else is worth 0 points. |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<configuration> | |
<system.webServer> | |
<!-- snip --> | |
<!-- enables files up to 64MB --> | |
<security> | |
<requestFiltering> | |
<requestLimits maxAllowedContentLength="65536000" /> <!-- really? this is in bytes, not kb --> |
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
one: | |
email: [email protected] | |
encrypted_password: <%= User.new.send(:password_digest, "password") %> | |
authentication_token: <%= User.authentication_token %> |
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 PostsController < ActionController::Base | |
def create | |
Post.create(post_params) | |
end | |
def update | |
Post.find(params[:id]).update_attributes!(post_params) | |
end | |
private |
OlderNewer