Skip to content

Instantly share code, notes, and snippets.

kofifus / gist:9360bdf9d98925c2e6ab6ccba4fa18ad
Created August 23, 2021 02:47
HttpFile GetToFileAsync, GetToStringAsync, PostToStringAsync
View gist:9360bdf9d98925c2e6ab6ccba4fa18ad
namespace System.Net.Http {
// holds the non disposable parts of HttpResponseMessage
public record HttpResponseInfo(HttpResponseHeaders Headers, bool IsSuccessStatusCode, string? ReasonPhrase, HttpStatusCode HttpStatusCode, HttpResponseHeaders TrailingHeaders, Version Version);
// holds Http exception information
public record HttpExceptionInfo(string ErrorMessage, WebExceptionStatus? WebExceptionStatus);
public record HttpResponse {
public HttpResponseInfo? HttpResponseInfo { get; init; }
kofifus /
Last active January 31, 2023 05:17
Filter Facebook Marketplace to only show entries in the last hour
kofifus /
Created August 26, 2018 08:49 — forked from PurpleBooth/
A template to make good

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.


View Javascript 'class' pattern
Going over the usually recommended 'classes' solutions I ended up dissatisfied with all of them, mainly:
- using ES6 class, I have no real private variables/methods and my code is full with this._ which is really ugly
- using the crockford way, private methods have this unaassigned (or ===window) which is very confusing and
error prone and need the 'that=this' hack thing to work properly
- other soloutions ie weakmaps and symbols create complicated ugly code
- in any of the above ways it is hard to have a clear view of the public interface of the class
kofifus / Codemirror spellchecker with typo corrections
Last active September 23, 2022 17:12
CodeMirror spell checker with typo correction
View Codemirror spellchecker with typo corrections
// include codemirror.js, addon/mode/overlay.js
// include async typo.js from
// include loadTypo.js from:
// loading typo + dicts takes a while so we start it first
// hosting the dicts on your local domain will give much faster loading time
// english dictionaries taken from