Skip to content

Instantly share code, notes, and snippets.

@JohannesRudolph
JohannesRudolph / gist:1006783640ac06840787
Last active August 29, 2015 14:25
Some Scala Basics
object PathDependentTypes extends App {
class Food {}
class Grass extends Food {}
class DogFood extends Food {}
abstract class Animal {
// SuitableFood is a subtype of Food, deriving classes must define it
type SuitableFood <: Food
def eat(food: SuitableFood)
}
import rescala._
import rescala.events.{ Event, ImperativeEvent }
import makro.SignalMacro.{SignalM => Signal}
object ReScalaDemo extends App {
/*
Observer criticism
- inverts natural dependency order (listeners call soure to register)
@JohannesRudolph
JohannesRudolph / AutoIndexFailsRepro.cs
Created February 9, 2015 11:39
AutoIndexFailsRepro
public class AutoIndexMerging : RavenTest
{
const string SampleLogfileStoreId = "123";
[Fact]
public async Task AutoIndexReuseFails()
{
var store = NewRemoteDocumentStore( fiddler: true );
var session = store.OpenAsyncSession();
@JohannesRudolph
JohannesRudolph / SimpleSpec.cs
Last active August 29, 2015 14:03
SubSpec with nested Lambdas. Need to find a better name.
// MS-PL License.
// Author Johannes Rudolph <jojo.rudolph@gmail.com>
// This license governs use of the accompanying software. If you use the software, you accept this license. If you do not accept the license, do not use the software.
// 1. Definitions
// The terms "reproduce," "reproduction," "derivative works," and "distribution" have the same meaning here as under U.S. copyright law.
// A "contribution" is the original software, or any additions or changes to the software.
// A "contributor" is any person that distributes its contribution under this license.
// "Licensed patents" are a contributor's patent claims that read directly on its contribution.
@JohannesRudolph
JohannesRudolph / MarkReadOnlyBug
Created July 11, 2013 12:31
RavenDb Session.Advanced.MarkReadOnly bug? repro
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Xunit;
namespace Raven.Tests.Bugs
{
public class MarkReadOnly : RavenTest
{
@JohannesRudolph
JohannesRudolph / nunit.lite.teamcity.cs
Last active December 16, 2015 12:18
Simple teamcity test status reporter for for nunit.lite
public class TeamcityTestReporter : ITestReporter
{
TextWriter writer;
public TeamcityTestReporter( System.IO.TextWriter writer )
{
this.writer = writer;
}
public void TestSuiteStarted( NUnit.Framework.Internal.TestSuite ts )
Apr 17 10:43:20 iDevPod01 installd[52] <Error>: 0x2fe93000 handle_install: Install of "/var/mobile/Media/PublicStaging/RowMotionBoatAppiOS.app" requested by mobile_installation_proxy
Apr 17 10:43:21 iDevPod01 installd[52] <Error>: 0x2fe93000 MobileInstallationInstall_Server: Installing app rowmotionboatappios
Apr 17 10:43:21 iDevPod01 installd[52] <Error>: Apr 17 10:43:21 SecTrustEvaluate [leaf CriticalExtensions IssuerCommonName]
Apr 17 10:43:22 iDevPod01 installd[52] <Error>: entitlement 'keychain-access-groups' has value not permitted by a provisioning profile
Apr 17 10:43:22 iDevPod01 installd[52] <Error>: entitlement 'application-identifier' has value not permitted by a provisioning profile
Apr 17 10:43:22 iDevPod01 SpringBoard[66] <Warning>: Killing rowmotionboatappios for termination assertion
Apr 17 10:43:22 iDevPod01 com.apple.launchd[1] (UIKitApplication:rowmotionboatappios[0xc6dc][1328]) <Notice>: (UIKitApplication:rowmotionboatappios[0xc6dc]) Exited: Killed: 9
Apr 17 10:43:22 iDevP
#!/bin/sh
# Launch application using ios-sim and set up environment to inject test bundle into application
# Source: http://stackoverflow.com/a/12682617/504494
if [ "$RUN_APPLICATION_TESTS_WITH_IOS_SIM" = "YES" ]; then
test_bundle_path="$BUILT_PRODUCTS_DIR/$PRODUCT_NAME.$WRAPPER_EXTENSION"
environment_args="--setenv DYLD_INSERT_LIBRARIES=/../../Library/PrivateFrameworks/IDEBundleInjection.framework/IDEBundleInjection --setenv XCInjectBundle=$test_bundle_path --setenv XCInjectBundleInto=\"$TEST_HOST\""
testhost_dir=$(dirname "$TEST_HOST")
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net.Http;
using System.Net.Http.Formatting;
using System.Text;
using System.Threading.Tasks;
using Xunit;
using System.IO.Compression;
@JohannesRudolph
JohannesRudolph / Demo.cs
Created December 20, 2012 17:39
Simple spec. A minimalisitic specification framework for xunit.net. MS-PL License.
using SimpleSpec;
using System;
using System.Collections.Generic;
using System.Linq;
using Xunit;
namespace SimpleSpec.Tests
{
public class Demo
{