Skip to content

Instantly share code, notes, and snippets.

Thomas Bandt aspnetde

Block or report user

Report or block aspnetde

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@aspnetde
aspnetde / foo.md
Last active May 5, 2020
Setting a fucking environment variable on macOS
View foo.md
  1. Open Vim (vi ~/.bash_profile)

  2. Add the entry (i)

  3. Exit (Esc + :wq)

  4. Refresh (source ~/.bash_profile)

View AcciadoArticles.config
<?xml version="1.0" encoding="UTF-8"?>
<settings>
<hitlist>
<connectionString>" &amp; Session("defaultConnectionString") &amp; "</connectionString>
<hitlistDataSource>ViewAcciadoAdminHitlistArticles</hitlistDataSource>
<hitlistDataSourceOrphaned>ViewAcciadoAdminArticlesWithoutReferences</hitlistDataSourceOrphaned>
<recordsPerPage>25</recordsPerPage>
View Cmd.cs
namespace MvuCsharp
{
public class Cmd
{
public static readonly Cmd None = new Cmd();
public static Cmd OfMsg(IMessage msg) => new Cmd(); // TODO
}
}
View App.fs
namespace FabulousSubModules
open Fabulous.Core
open Fabulous.DynamicViews
open Xamarin.Forms
module App =
type Model =
{ Global: GlobalModel
Page1: Page1.Model
View fsharp-formatting.fsx
namespace Foo
module Bar =
let RelationsReducer (state:RelationState) action =
match action with
| ActivitiesRequestSucceeded (id, items)
-> { state with FacilityActivity = state.FacilityActivity |> Array.filter (fun (f, _) -> f <> id)
|> Array.append (items |> Array.map (fun item -> (id, item.Id))) }
| _ -> state
@aspnetde
aspnetde / ggt.fsx
Created Jun 20, 2017
Erweiterter Euklidischer Algorithmus
View ggt.fsx
let rec ggT a b =
let r = a % b
if r = 0 || r = b then
b, 0, 1
else
let q = a / b
let g, s, t = ggT b r
g, t, s - q * t
@aspnetde
aspnetde / demo.fsx
Created May 7, 2017
F# Interactive -> System.BadImageFormatException (Mono)
View demo.fsx
#r "System.Net.Http"
open System.Net.Http
type Foo = Foo of HttpRequestMessage
@aspnetde
aspnetde / DroidTlsClientHandler.cs
Created Jan 17, 2017
An AndroidClientHandler implementation supporting Certificate Pinning
View DroidTlsClientHandler.cs
using System.IO;
using Java.Security;
using Java.Security.Cert;
using Javax.Net.Ssl;
using Xamarin.Android.Net;
namespace NeunundsechzigGrad.Foo
{
public class DroidTlsClientHandler : AndroidClientHandler
{
View foo.fs
[<Test>]
let ``Die Backtick-Syntax ist eigentlich ganz cool, wenn man sich mal daran gewöhnt hat.``() =
Assert.IsTrue(true)
@aspnetde
aspnetde / fake-failing-test.fsx
Created Oct 6, 2016
FAKE Failing Test (with PlistBuddy)
View fake-failing-test.fsx
#r "tools/FAKE/FakeLib.dll"
open Fake
open System
open System.IO
let Exec command args =
let result = Shell.Exec(command, args)
if result <> 0 then failwithf "%s exited with error %d" command result
You can’t perform that action at this time.