Skip to content

Instantly share code, notes, and snippets.

View robashton's full-sized avatar
🍻
drinking

His Excellence Sir Professional of Rob upon Ashtonburyshirester robashton

🍻
drinking
View GitHub Profile
@robashton
robashton / test.cs
Created February 17, 2013 07:52
What my use of mocking frameworks looks like in C# vs JavaScript
// CSharp
@robashton
robashton / dynamic-query.cs
Created February 14, 2013 08:22
I'm quite pleased with this new feature
var ordersForCustomer = session.Query<Order>()
.Where(order => order.CustomerId == "customers/bob")
.TransformWith<OrderWithProductInformation, OrderWithProductInformation.Result>()
.List();

If you ask most professional developers (as compared to a Hobbyist, see "What's the Difference between a Hobbyist and a Professional") about JavaScript and you'll likely get non-positive responses. Most professional developers – that is those that get paid – don't like JavaScript because it's hard to make a craft of developing when you're limited by your language. Most professional developers have come to expect a set of tools to help them develop more reliable code and to create the code faster in the first place. JavaScript isn't bad for tying a few loose things together, however, developing enterprise scale applications is not what it was designed for.

@robashton
robashton / index.html
Created October 28, 2012 17:55
Push-based dom templating with cheerio
<h1></h1>
<section>
<div class="hotel">
<h5 class="hotel-name"></h5>
<p class="hotel-description"></p>
</div>
</section>
<!-- Trying to use the HTML elements themselves as selectors will lead to pain because the designer should be able to change that crap and you shouldn't have to worry which elements they've used, classes/ids are saner -->
package samples
import kspec.framework.*
spec public fun calculatorSpecs() {
var calculator = null
var sum = 0
given("a calculator", {
calculator = Calculator()
@robashton
robashton / ConsoleSpinner.cs
Created October 10, 2012 12:45 — forked from gab-aquino/ConsoleSpinner.cs
ConsoleSpinner
static void Main(string[] args)
{
ConsoleSpinner spin = new ConsoleSpinner();
Console.Write("Working....");
while (true)
{
spin.Turn();
}
}
@robashton
robashton / curry.md
Created October 10, 2012 11:50
Curry on Friday Night
@robashton
robashton / gist:3609294
Created September 3, 2012 13:20
zombie.js
var Browser = require('zombie')
, client = new Browser()
client.visit('http://localhost', function() {
client.fill('title', 'This is an awesome blog entry')
client.click('submit')
})
@robashton
robashton / gist:3011019
Created June 28, 2012 12:17
Keyboard.clj
(defn onKeyDown [e]
(.log js/console "down")
)
(defn onKeyUp [e]
(.log js/console "up")
)
(defn hookKeyboard []
(.addEventListener js/document "keydown" onKeyDown)
@robashton
robashton / gist:3010659
Created June 28, 2012 10:55
hmm.coffee
Scenario "Bootstrapping the game", ->
context = new ManualContext()
bob = null
alice = null
Given "a server in a ready state", (done) ->
context.start(done)
When "bob connects", (cb) ->
bob = context.add_client_called 'bob', cb
Then "bob should have a canvas displayed", ->