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 | |
command=`basename "$0"` | |
run-windows-command "$command" "$@" |
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 IObservable<TResult> FromTdf<T, TResult>(this IObservable<T> source, | |
Func<IPropagatorBlock<T, TResult>> blockFactory) => Observable.Create<TResult>(observer => { | |
var block = blockFactory(); | |
var dsp1 = block.AsObservable().Subscribe(observer.OnNext); | |
var dsp2 = source.Subscribe(block.AsObserver()); | |
return new CompositeDisposable {dsp2, dsp1}; | |
}); | |
public static IObservable<TResult> FromTdf<T, TResult>(this IObservable<T> source, | |
IPropagatorBlock<T, TResult> block) => source.FromTdf(() => block); |
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
/// <summary> | |
/// A more closed version of the official SpecsFor class, | |
/// with some additional helpers | |
/// </summary> | |
/// <typeparam name="T"></typeparam> | |
public abstract class SpecsFor<T> : SpecsFor.SpecsFor<T>, IAnd<T> where T : class | |
{ | |
protected abstract override void Given(); | |
protected abstract override void When(); | |
public sealed override void TearDown() => base.TearDown(); |
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
readonly ICollection<Action> _transactionCallbacks = new Collection<Action>(); | |
public override int SaveChanges() { | |
int r; | |
try { | |
ExecuteDomainEvents(); | |
r = base.SaveChanges(); | |
} catch (Exception) { | |
_transactionCallbacks.Clear(); | |
throw; |
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 class TestViewModel : ReactiveObject | |
{ | |
const int _intVal = 1; | |
public int IntVal { get { return _intVal; } } | |
ObservableAsPropertyHelper<int> _MyReactiveVal; | |
public int MyReactiveVal | |
{ | |
get { return _MyReactiveVal.Value; } | |
} |
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
// Workaround for RXUi, first object initialization must be on UI Thread | |
private class DummyModel : BindableBase | |
{ | |
private ObservableAsPropertyHelper<string> _propertyHelper; | |
public string PropertyHelper | |
{ | |
get { return _propertyHelper.Value; } | |
} | |
private string _Name; |
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
Type: System.Exception | |
Message: An OnError occurred on an object (usually ObservableAsPropertyHelper) that would break a binding or command. To prevent this, Subscribe to the ThrownExceptions property of your objects | |
Source: ReactiveUI | |
TargetSite: Void <.cctor>b__2() | |
Data: System.Collections.ListDictionaryInternal | |
RubyMessage: An OnError occurred on an object (usually ObservableAsPropertyHelper) that would break a binding or command. To prevent this, Subscribe to the ThrownExceptions property of your objects | |
Inner Exception: | |
Type: System.NullReferenceException | |
Message: Object reference not set to an instance of an object. | |
Source: System |
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
<Window x:Class="WpfApplication3.MainWindow" | |
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |
Title="MainWindow" Height="350" Width="525"> | |
<Grid> | |
<StackPanel Orientation="Horizontal"> | |
<StackPanel Margin="5"> | |
<StackPanel Orientation="Horizontal"> | |
<TextBlock Text="Original Count" /> | |
<TextBlock Margin="5,0,0,0" Text="{Binding Col.Count}" /> |
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
// this script checks if there arent too many magazines or respawns according to available slots | |
_count = count (configFile >> "CfgVehicles"); | |
_prefix = "t1o_"; | |
_vehicleName = ""; | |
_singleError = false; | |
// Remove this | |
_msg = format["_count: %1", _count]; | |
diag_log [diag_frameNo, diag_tickTime, time, _msg]; |
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
#!/usr/bin/env ruby | |
# Usage: | |
# ruby plugin_to_gem.rb my_plugin_directory | |
require 'fileutils' | |
@plugin_dir = ARGV[0] | |
@plugin_name = File.basename ARGV[0] | |
def rakefile_content | |
description = 'TODO' |