Skip to content

Instantly share code, notes, and snippets.

View alistair's full-sized avatar

Alistair Bush alistair

  • Auckland, New Zealand
View GitHub Profile
run-junit-interpreted-short:
[echo] compile=OFF, jit.threshold=20, jit.maxsize=1000000000, jit.max=-1, objectspace=true threadpool=false reflection=false version=ruby1_8
[junit] Testsuite: org.jruby.test.ScriptTestSuite
[junit] Tests run: 79, Failures: 0, Errors: 0, Time elapsed: 17.193 sec
[junit]
[junit] Testsuite: org.jruby.test.JRubyTestSuite
[junit] /var/tmp/portage/dev-java/jruby-1.5.1-r1/work/jruby-1.5.1
[junit] Tests run: 114, Failures: 1, Errors: 0, Time elapsed: 116.979 sec
[junit]
[junit] ------------- Standard Output ---------------
@alistair
alistair / gist:6206923
Created August 11, 2013 21:28
"Secure" ( by ip address) a public Endpoint at the load balancer
#Cloud Services which communicate with target
$sourceServices = @( 'source1', 'source2' )
#The thing being communicated with
$targetServices = @( 'target1' )
#name of public endpoint
$endpointName = 'eventstore'
$lbSetName = '$myendpoint-80'
$order = 0
#Modified and simplified version of https://www.windowsazure.com/en-us/develop/net/common-tasks/continuous-delivery/
$subscription = "[Your Subscription Name]"
$service = "[Your Azure Service Name]"
$slot = "staging" #staging or production
$package = "[ProjectName]\bin\[BuildConfigName]\app.publish\[ProjectName].cspkg"
$configuration = "[ProjectName]\bin\[BuildConfigName]\app.publish\ServiceConfiguration.Cloud.cscfg"
$timeStampFormat = "g"
$deploymentLabel = "ContinuousDeploy to $service v%build.number%"
Write-Output "Running Azure Imports"
@alistair
alistair / gist:9517525
Created March 12, 2014 22:08
ravendb action behaviour
public class RavenDbBehavior : IActionBehavior
{
private readonly IDocumentSession _session;
public IActionBehavior InsideBehavior { get; set; }
public RavenDbBehavior(IDocumentSession session)
{
_session = session;
}
public class FeatureViewLocationRazorViewEngine : RazorViewEngine
{
public FeatureViewLocationRazorViewEngine()
{
ViewLocationFormats = new[]
{
"~/Features/{1}/{0}.cshtml",
"~/Features/{1}/{0}.vbhtml",
"~/Features/Shared/{0}.cshtml",
"~/Features/Shared/{0}.vbhtml",
======================================================
======================================================
//File toggle.js
// All the logic for getting toggle information
exports = function FeatureToggle(toggleName, offFunc, onFunc) {
return function() {
if (toggleOn(toggleName))
public interface IAmAFeature {
public void Blah();
}
public interface WelcomeEmailFeature {
public void Blah() {
// Send email with no jobs.
}
}
===========================
===========================
// file1.js
var a = function() {
}
exports.b = function() {
var a = function() {
#haskell
foldr (.) id [inc, inc, inc] $ 0
data Event
= AccountCreated Email
| AccountLoggedIn
| Start
case class State(emailAddress: String, loginCount: Int, failedLoginCount: Int, locked: Boolean) {
/* Login to go here */
}
abstract class Event() {
def apply(s: State): State
}
case class AccountCreated(emailAddress: String) extends Event {