This file contains hidden or 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
class ContactFinder { | |
#db; | |
#chatToFind; | |
#dbName = "model-storage"; | |
#chatsCol = "chat"; | |
#contactCol = "contact"; | |
#groupCol = "participant"; | |
constructor(chatGroupName) { | |
this.#chatToFind = chatGroupName; |
This file contains hidden or 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
using Nest; | |
using System; | |
using System.Globalization; | |
namespace elasticsearch_nest_geoindex_demo | |
{ | |
public class Location | |
{ | |
public string Name { get; set; } |
This file contains hidden or 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
namespace Elasticsearch.Net.Connection | |
{ | |
using System.Globalization; | |
using System; | |
using System.Text; | |
/// <summary> | |
/// HttpConnection with basic auth usage | |
/// </summary> | |
public sealed class BasicAuthHttpConnection : HttpConnection |
This file contains hidden or 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 MvcApplication : HttpApplication | |
{ | |
private static void initializeLogging() | |
{ | |
var loggerConfiguration = new LoggerConfiguration() | |
.Enrich.WithProperty("type", "application") | |
.Enrich.WithProperty("application", "my-app-name") | |
.Enrich.WithProperty("application_version", "1.2.3.4") | |
.Enrich.WithProperty("environment", "development") | |
.Enrich.With<Serilog.Extras.Web.Enrichers.HttpRequestIdEnricher>() |
This file contains hidden or 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
# part one, put on your scrubs | |
mkdir git-surgery | |
cd git-surgery | |
git clone git@github.com:crunchie84/blogpost-git-surgery-source.git source | |
cd source | |
# extract our application from the source repository | |
git subtree split -P Configuration/application-1 -b rewritten-history-application-1 | |
# Prepare our new repository |
This file contains hidden or 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
Rx.Observable.timer(0, 10 * 1000) | |
.switchMap(_ => fetch('https://blockchain.info/ticker?cors=true') | |
.then(res => res.json()) | |
.then(parsed => parsed.EUR.buy) | |
) | |
.distinctUntilChanged() | |
.scan((acc, curr) => ({ | |
delta: Math.round((acc.value - curr || 0) * 100) / 100, | |
value: curr | |
}), {}) |
This file contains hidden or 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
import 'rxjs/add/observable/empty'; | |
import 'rxjs/add/operator/do'; | |
import 'rxjs/add/operator/concat'; | |
import 'rxjs/add/operator/finally'; | |
import { Observable } from "rxjs"; | |
/** | |
* | |
* Lifecycle debugging for your stream, sub/unsubscribe,complete and values | |
* |
This file contains hidden or 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
# | |
# Include this in your own .gitconfig by using the | |
# [include] directive with the path to this file | |
# | |
# [include] | |
# path = ~/.gitconfig.aliases | |
# | |
# If you don't have any existing includes, you can add this via the following command | |
# | |
# git config --global include.path ~/.gitconfig.aliases |
This file contains hidden or 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
const assert = require('chai').assert; | |
/** | |
* parts of code taken from https://github.com/Reactive-Extensions/RxJS/blob/master/tests/helpers/reactiveassert.js#L32 | |
* | |
* and modified to work with the rxjs5 testing shim which has no differentiation between values and predicates | |
*/ | |
exports.assertEqual = function assertEqual(actual, expected) { | |
const comparer = require('./is-equal'); // copied and adapted from https://raw.githubusercontent.com/Reactive-Extensions/RxJS/master/src/core/internal/isequal.js | |
let isOk = true; |
NewerOlder