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
//HomeController | |
public ActionResult Foo() | |
{ | |
if(Request.IsAjaxRequest()) | |
{ | |
return View("_foo"); | |
} | |
return View(); | |
} |
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(var db = new FooDataContext()) | |
{ | |
foreach(var row in table) | |
{ | |
Car car = (from c in db.Cars | |
where c.Id = row["CAR_ID"]).SingleOrDefault(); | |
if(car == null) | |
car = new Car(); | |
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
<delete verbose="true"> | |
<fileset> | |
<include name="**/bin"/> | |
<include name="**/obj"/> | |
</fileset> | |
</delete> |
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
// Customize the appearance of table view cells. | |
- (UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *)indexPath { | |
static NSString *CellIdentifier = @"Cell"; | |
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; | |
if (cell == nil) { | |
cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:CellIdentifier] autorelease]; | |
cell.opaque = NO; | |
cell.textLabel.backgroundColor = [UIColor clearColor]; |
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
public static string Pluralize(this string str) | |
{ | |
if(str.EndsWith("s")) | |
return str + "es"; | |
return str + "s"; | |
} |
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
<?xml version="1.0" encoding="utf-8" ?> | |
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" | |
assembly="YOUR_ASSEMBLY" | |
namespace="YOUR_NAMESPACE"> | |
<class name="Foo" table="foos"> | |
<id name="id"> | |
<generator class="identity"/> | |
</id> | |
<property name="Bar" not-null="true"/> | |
</class> |
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 CompressedRequests | |
def initialize(app) | |
@app = app | |
end | |
def call(env) | |
if env['REQUEST_METHOD'] =~ /(POST|PUT)/ | |
if env.keys.include? 'HTTP_CONTENT_ENCODING' | |
input = env['rack.input'].read |
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
[~/cool-app (master)]$ bundle install | |
Fetching source index for http://rubygems.org/ | |
Using rake (0.8.7) | |
Using ZenTest (4.4.0) | |
Using abstract (1.0.0) | |
Using activesupport (3.0.1) | |
Using builder (2.1.2) | |
Using i18n (0.4.2) | |
Using activemodel (3.0.1) | |
Using erubis (2.6.6) |
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
VCR.config do |c| | |
c.cassette_library_dir = 'fixtures/cassettes' | |
c.stub_with :webmock | |
end | |
class VCRSavonTest < Test::Unit::TestCase | |
def setup | |
path = File.expand_path("../fixtures/cassettes", __FILE__) | |
`rm -rf #{path}` | |
end |
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
group :development, :test do | |
gem 'capybara' | |
gem 'rspec' | |
gem 'rspec-rails' | |
gem 'autotest' | |
gem 'autotest-rails' | |
gem 'cucumber' | |
gem 'cucumber-rails' | |
gem 'database_cleaner' | |
gem 'pickler' |
OlderNewer