This blog is based on gistblog.
It is currently hosted on azure as Rarely updated.
This blog is based on gistblog.
It is currently hosted on azure as Rarely updated.
This blog exists purely a learning experience. See the source code here.
As you may notice, the blog posts are actually github gists (http://gist.github.com/). It is based on gistblog (see also http://withouttheloop.com/).
Software
I am not good at writing bug-free code in JavaScript or CoffeeScript. I am equally not good at writing bug-free tests. It would be nice to have a way to quickly build a basic 'safety net' for my code, and be able to describe the tests in a format less verbose than 'describe->it-should->etc'.
It should also be a good learning experience.
How do you create a CoffeeScript class instance using 'apply'?
The answer is, like this:
util = require('util')
assert = require('assert')
class MyClass
constructor: (@splatArgs...) -> @first = splatArgs[0]; @second = splatArgs[1]
I do all my work on a laptop.
Recently we had a tricky defect raised where, under certain circumstances, the user-entered values were not being persisted. The page was a somewhat complex data entry form, with many fields, lots of validation, and a complex hierarchy of view model objects and controls/helpers.
After reproducing the issue (which itself was difficult), the first thing we did was to attach the debugger and set a break point on the first line of the controller action.
private class SpecimenWithEverything | |
{ | |
public enum MyEnum | |
{ | |
MyFirstValue, | |
MySecondValue, | |
MyThridValue, | |
} | |
public string String1 { get; set; } |
diff --git a/Octokit.Tests/OctoKit.Tests-NetCore45.csproj b/Octokit.Tests/OctoKit.Tests-NetCore45.csproj | |
index 351d930..00bf659 100644 | |
--- a/Octokit.Tests/OctoKit.Tests-NetCore45.csproj | |
+++ b/Octokit.Tests/OctoKit.Tests-NetCore45.csproj | |
@@ -1,5 +1,5 @@ | |
?<?xml version="1.0" encoding="utf-8"?> | |
-<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | |
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | |
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuild | |
<PropertyGroup> |
let whereNotExistsIn itemsToExclude itemToTest = | |
itemsToExclude |> Seq.exists (fun j -> itemToTest = j) |> not | |
let except itemsToExclude allItems = | |
allItems |> Seq.filter (whereNotExistsIn itemsToExclude) | |
[| "one"; "two"; "three"; |] | |
|> except [|"two"|] | |
|> Dump |
let except ex all = all |> Seq.filter (not << Set.ofSeq(ex).Contains) | |
let filtered = [| 1..1000000 |] |> except [| 20..29 |] | |