Skip to content

Instantly share code, notes, and snippets.

View haf's full-sized avatar
💹
currently succeeding...

Henrik Feldt haf

💹
currently succeeding...
View GitHub Profile
@haf
haf / Supervisor.fs
Last active August 29, 2016 07:18
Supervision Hopac
module Logary.Supervisor
open System
open Hopac
open Hopac.Infixes
open NodaTime
type PolicyStep =
| Sleep of dur:Duration
| RestartOne
@haf
haf / Usage.txt
Last active April 20, 2018 13:33
Unlist lots of NuGet packages
Unlist all v4.* packages:
$ ./unlist.rb MyPackage v4.
Unlist specific version:
$ ./unlist.rb MyPackage v2.3.5
Unlist all versions:
@haf
haf / gist:1b02df5f9aef88addfc27a61f26d07da
Last active August 5, 2016 17:06
Checklist when adding a new F# project
- Do you have the latest mono?
- .travis.yml
- appveyor.ml
- Ensure .Net is 4.5 or mono doesn't compile it
- Ensure all .Tests have App.config or Windows doesn't compile it
- Add the bloody app.config as content to the fsproj file or it doesn't end up in the output folder
- Remove reference to FSharp.Core because you're a effing bot who likes to edit XML
- `add -f` `paket-files/`-files to make it more approachable
- `system` doesn't work with quotes in albacore, use `sh` instead
- Stare at the build complexity here https://github.com/fsprojects/FsProjectsAdmin/issues/10#issuecomment-237898162 to
'GET /': 2.0.0.0 was 1.25x faster and 1.95x more memory efficient than 0.34.0.0.
'GET /': 2.0.0.0 was 1.83x faster and 0.22x more memory efficient than 1.0.0.0.
'GET /': 2.0.0.0 was 1.68x faster and 0.31x more memory efficient than 1.1.1.0.
'POST / n' mirror': 2.0.0.0 was 1.20x faster and 3.54x more memory efficient than 0.34.0.0.
'POST / n' mirror': 2.0.0.0 was 1.72x faster and 0.34x more memory efficient than 1.0.0.0.
'POST / n' mirror': 2.0.0.0 was 1.49x faster and 0.48x more memory efficient than 1.1.1.0.
@haf
haf / index.js
Created February 23, 2016 17:36
Intro to JavaScript
// Hello World
@haf
haf / keybase.md
Last active December 7, 2015 11:58

Please publicly post the following Gist, and name it keybase.md

Keybase proof

I hereby claim:

  • I am haf on github.
  • I am haf (https://keybase.io/haf) on keybase.
  • I have a public key ASDJ2Iyjt10Q0n7_jRMQrKDVoTqpBFN0Vlx1iaFKtTXMjQo
Trouble with Transactions
This is a piece on why you should use transactions.
The trouble with transactions in contemporary programming is that the APIs for
transactions don't fit how applications are written. Say you want to support
transactions in your app, how would you go about?
First of all, you're already doing implicit transactions around each SQL
statements. So you are moving away from this model if you're changing how you
@haf
haf / Dockerfile
Last active August 29, 2015 14:26
FROM centos:latest
MAINTAINER Henrik Feldt <henrik@haf.se>
ENV BUILD_PREFIX /tmp/build
ENV APP_PREFIX /app
ENV LISTEN_PORT=8083
RUN mkdir -p $BUILD_PREFIX
COPY paket.dependencies $BUILD_PREFIX/paket.dependencies
COPY paket.lock $BUILD_PREFIX/paket.lock
pcregrep --color=auto -I -l -r -n '[\xf6]' *.php | xargs -I{} sh -c "iconv -f iso-8859-1 -t utf-8 {} > {}.new && mv {}.new {}";
@haf
haf / LICENSE
Last active February 14, 2024 11:15
Setting up a digitalocean proxy
https://www.gnu.org/licenses/gpl-3.0.en.html
GNU GENERAL PUBLIC LICENSE v3