My contention: if you have dedicated testers, you're (probably) doing it wrong. Instead of having separate developers, testers, and project managers, just have one role: doers. I see more and more teams switching to role-less craftsmen; that's good, but I often see these teams struggle when deciding who tests what, and how. My goals for this talk, then, are to first convince you to do away with dedicated testers, and then to prepare you to do so susccessfully (as well as anyone can prepare you for such an undertaking in an hour's time).
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
#!/bin/bash | |
# first run 'rails my-app' and 'cd my-app' | |
git init | |
touch .gitignore | |
echo -e "log/*.log\ntmp/**/*\ndoc/api\ndoc/app\ndb/*.sqlite3" >> .gitignore | |
touch log/.gitignore | |
touch tmp/.gitignore | |
touch public/stylesheets/.gitignore |
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
require 'base64' | |
require 'digest/sha2' | |
def create(text) | |
salt_bytes = random_salt | |
salted_hash_bytes = Digest::SHA256.digest(salt_bytes+text) | |
Base64::encode64(salt_bytes+salted_hash_bytes) | |
end | |
def verify(hash, text) |
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
function Get-SaltedHash { | |
param($text) | |
$csp = new-object System.Security.Cryptography.RNGCryptoServiceProvider | |
$hashAlgorithm = new-object System.Security.Cryptography.SHA256Managed | |
$saltBytes = new-object byte[] 8 | |
$csp.GetNonZeroBytes($saltBytes) | |
$textBytes = [System.Text.Encoding]::UTF8.GetBytes($text) |
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 UrlHelper CreateUrlHelperToFakeIsLocalUrl(string fakeRequestUrl) | |
{ | |
var httpContextBase = new Mock<HttpContextBase>(); | |
httpContextBase.Setup(x => x.Request.Url).Returns(new Uri(fakeRequestUrl)); | |
var requestContext = new RequestContext(httpContextBase.Object, new RouteData()); | |
return new UrlHelper(requestContext); | |
} | |
// controller.Url = CreateUrlHelperToFakeIsLocalUrl("http://aFakeHost/aFakePage"); |
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 linksArray = DomUtils.getElementsByTagName("link", item.children, false); | |
var entryLink = linksArray[0].attribs.href; | |
for (var i = 0; i < linksArray.length; i++) { | |
var linkRel = linksArray[i].attribs.rel.toLowerCase(); | |
if (linkRel === 'alternate') { | |
entryLink = linksArray[i].attribs.href; | |
break; | |
} | |
} | |
entry.link = entryLink; |
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
use NuGetGallery | |
BEGIN TRAN | |
DECLARE @PackageRegistrationId nvarchar(max) | |
SET @PackageRegistrationId = '<id>' | |
ALTER TABLE GallerySettings NOCHECK CONSTRAINT ALL | |
DELETE FROM PackageStatistics |
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
on :say do | |
nick, text = connection[:nick], data[:text] | |
raise NickRequiredError if nick.nil? | |
broadcast :said, { :nick => nick, :text => text } | |
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
// My app uses event sourcing, and I need a collection of all the app's event processors. | |
// I don't want to maintain this collection by hand, changing every time I add a new processor. | |
// So, I build up the collection dynamically when the app starts by examining the module cache. | |
// Caveat: I have no idea whether accessing `require.cache` is supported. | |
// Note: An event processor is any exported constructor function that ends with 'EventProcessor'. | |
exports.buildEventProcessorCollection = function() { | |
var eventProcessors = { }; | |
for (var id in require.cache) { | |
var mod = require.cache[id]; |
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 allPackageVersions = packagesQuery.ToList(); | |
var packageVersions = allPackageVersions; ; | |
if (String.IsNullOrEmpty(version) && !allowPrerelease) | |
{ | |
// If there's a specific version given, don't bother filtering by prerelease. You could be asking for a prerelease package. | |
packageVersions = packageVersions.Where(p => !p.IsPrerelease).ToList(); | |
} |
OlderNewer