Skip to content

Instantly share code, notes, and snippets.

View object's full-sized avatar

Vagif Abilov object

View GitHub Profile
@object
object / SpecFlow.MsTest.cs
Created March 26, 2012 16:34
SpecFlow-generated code
// ------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by SpecFlow (http://www.specflow.org/).
// SpecFlow Version:1.8.1.0
// SpecFlow Generator Version:1.8.0.0
// Runtime Version:4.0.30319.261
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
@object
object / DynamicTest_iOS
Created May 17, 2013 12:06
C# dynamic test for iOS
using System.Dynamic;
using NUnit.Framework;
namespace DynamicTest
{
public class TestObject : DynamicObject
{
public override bool TryGetMember(GetMemberBinder binder, out object result)
{
if (binder.Name == "MeaningOfLife")
@object
object / gist:a7139800bd8e9fa8358c
Created July 22, 2014 08:24
Serilog log4net sink problem
1. Create console app.
2. Install log4net, Serilog and Serilog.Sinks.log4net NuGet packages.
3. Add log4net.config:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" />
</configSections>
{"Timestamp":"2014-12-01T00:00:13.2834210+01:00","Level":"Debug","MessageTemplate":"Fetching all changes from domain {Domain} since {SinceTime} (UTC: {SinceUTC})","RenderedMessage":"Fetching all changes from domain \"ndoa\" since 11/30/2014 13:42:14 (UTC: 11/30/2014 12:42:14)","Properties":{"Domain":"ndoa","SinceTime":"2014-11-30T13:42:14.0000000+01:00","SinceUTC":"2014-11-30T12:42:14.0000000Z"}}
{"Timestamp":"2014-12-01T00:00:13.2990212+01:00","Level":"Debug","MessageTemplate":"Search called for provider {ProviderName} with query={Query}","RenderedMessage":"Search called for provider \"g3db\" with query=\"Bridge.AssetService.G3.Queries.G3DbNotificationsByDateTimeQuery\"","Properties":{"ProviderName":"g3db","Query":"Bridge.AssetService.G3.Queries.G3DbNotificationsByDateTimeQuery","clientIp":"2002:a044:1512::a044:1512","sessionId":null}}
{"Timestamp":"2014-12-01T00:00:13.2990212+01:00","Level":"Debug","MessageTemplate":"Querying database for modified clips (including metadata-changed) newer than {ModifiedDate}
@object
object / Program.fs
Created August 25, 2015 07:55
FindFileDuplicates (sumbission to Kodekampen)
open System
open System.IO
open System.Diagnostics
open System.Collections.Generic
// Generic method to run parallel computations applied to elements of a collection
let runParallel f xs =
Async.Parallel [ for x in xs -> async { return f x } ]
|> Async.RunSynchronously
@object
object / gist:d335aac92e2d251aff1c
Created September 28, 2015 11:38
Trello: updating a card
Run(() =>
{
TrelloProcessor.WaitForPendingRequests = true;
var card = new Card("5609144868309d39826b61f1");
card.Name = "UPDATED: " + card.Name;
TrelloProcessor.Shutdown();
});
@object
object / gist:199b04d5057750a078de
Created September 28, 2015 11:39
Trello: adding a card comment
Run(() =>
{
TrelloProcessor.WaitForPendingRequests = true;
var card = new Card("5609144868309d39826b61f1");
card.Comments.Add("New comment");
TrelloProcessor.Shutdown();
});
[<AutoOpen>]
module SftpActors
open System
open Akka
open Akka.FSharp
open SftpClient
type SftpCommand =
| ListDirectory of Url
| UploadFile of UncPath * Url
let sftpActor (clientFactory : IClientFactory) (mailbox: Actor<_>) =
let rec disconnected () =
actor {
let! message = mailbox.Receive ()
match message with
| Connect ->
let connection = clientFactory.CreateSftpClient()
connection.Connect()
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Akka.Actor;
using Shared;
using Messages;
namespace Actors