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
var gulp = require('gulp'), | |
postcss = require('gulp-postcss'), | |
autoprefix = require('autoprefixer-core'); | |
gulp.task('css', function() { | |
return gulp.src('test.css') | |
.pipe(postcss([ autoprefix() ])) | |
.pipe(gulp.dest('dist/css')); | |
}); |
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
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 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 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 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 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 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 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: e@mail.com | |
encrypted_password: <%= User.new.send(:password_digest, "password") %> | |
authentication_token: <%= User.authentication_token %> |
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 PostsController < ActionController::Base | |
def create | |
Post.create(post_params) | |
end | |
def update | |
Post.find(params[:id]).update_attributes!(post_params) | |
end | |
private |
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
it "should create a new test set" do | |
expect { @preview_test.save }.should change(user.test_sets, :count).by(1) | |
@preview_test.test_set.tap do |t| | |
t.account.should == account | |
t.user.should == user | |
t.service.should == email_service | |
end.should be_valid | |
end | |
OlderNewer