Skip to content

Instantly share code, notes, and snippets.

DalSoft / webpack.config.js
Last active Jan 14, 2020
Webpack with multiple entries
View webpack.config.js
const glob = require('glob');
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const htmlPlugins = generateHtmlPlugins();
function generateHtmlPlugins() {
DalSoft / app.html
Last active Dec 5, 2019 — forked from lstarky/app.html
View app.html
<require from="styles.css" />
<require from="tree-view" />
<tree-view />
DalSoft / ValidateCertificateChain.cs
Created Jul 10, 2019
ValidateCertificateChain for custom Root CA
View ValidateCertificateChain.cs
private static bool ValidateCertificateChain(X509Certificate certificate)
var chain = new X509Chain();
var root = new X509Certificate2("ca.cer"); // Root CA of Self signed cert
var cert = new X509Certificate2(certificate);
chain.Reset(); // Not sure is this is needed
chain.ChainPolicy.VerificationFlags = X509VerificationFlags.IgnoreRootRevocationUnknown;
chain.ChainPolicy.RevocationMode = X509RevocationMode.Online; // Check with our own CA if the cert has been revoked
chain.ChainPolicy.ExtraStore.Add(root); // Self signed Root CA
DalSoft / bip39+bip32.cs
Created Nov 28, 2018 — forked from imyourm8/bip39+bip32.cs
BIP39 & BIP32 C# example implementation
View bip39+bip32.cs
This code allows you to export BIP39 12 words phrase and use it with Ethereum/Loom
To check Popular derivative paths look here
Or here is quick cheatsheet
Dependency on very nice library - clone and build it
using NBitcoin;
DalSoft / DalSoftDbContext.cs
Last active Mar 12, 2018
Entity Framework Core Migrations and Seeding
View DalSoftDbContext.cs
using System;
using System.IO;
using System.Linq.Expressions;
using System.Reflection;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.Extensions.Configuration;
namespace DalSoft.Data
DalSoft / Startup.cs
Last active Nov 25, 2015
Professional WebApi Part 1 - WebApi bootstrap without any bloat using Owin
View Startup.cs
public class Startup
public void Configuration(IAppBuilder app)
var config = new HttpConfiguration();
var jsonSerializerSettings = config.Formatters.JsonFormatter.SerializerSettings;
//Remove unix epoch date handling, in favor of ISO
jsonSerializerSettings.Converters.Add(new IsoDateTimeConverter { DateTimeFormat = "yyyy'-'MM'-'dd'T'HH':'mm':'ss.fff" });
DalSoft / CreateMessage.cs
Last active Aug 29, 2015
DalSoft.RestClient - dynamic C# rest client in action PushWoosh SDK
View CreateMessage.cs
// Method /createMessage
dynamic pushwoosh = new RestClient("");
var pushWooshResponse = await pushwoosh.CreateMessage.Post(new
request = new
application = "APPLICATION_CODE",
notifications = new[] { new {
send_date = "now", // YYYY-MM-DD HH:mm OR 'now'
DalSoft / Put.cs
Last active Aug 29, 2015
Introducing DalSoft.RestClient the dynamic rest client
View Put.cs
dynamic client = new RestClient("");
var post = new { title = "foo", body = "bar", userId = 10 };
var result = await client.Posts(1).Put(post);
Assert.That(result.title, Is.EqualTo(post.title));
Assert.That(result.body, Is.EqualTo(post.body));
Assert.That(result.userId, Is.EqualTo(post.userId));
Assert.That(result.HttpResponseMessage.StatusCode, Is.EqualTo(HttpStatusCode.OK));
DalSoft / Get.cs
Last active Aug 29, 2015
Introducing DalSoft.RestClient the dynamic rest client
View Get.cs
dynamic client = new RestClient("");
var post = await client.Posts(1).Get();
Assert.That(post.HttpResponseMessage.StatusCode, Is.EqualTo(HttpStatusCode.OK));
Assert.That(, Is.EqualTo(1));
DalSoft / h1.css
Last active Aug 29, 2015
Introducing Brunch Below is a trivial example, it's obviously not a production quality and is for brevity just to show brunch working
View h1.css
h1 {
font-size: 3rem;
You can’t perform that action at this time.