Skip to content

Instantly share code, notes, and snippets.

View njlr's full-sized avatar
🌏
F# ing

njlr njlr

🌏
F# ing
View GitHub Profile
@xgp
xgp / Dockerfile
Last active August 12, 2024 17:56
Keycloak 17 example using JGroups JDBC_PING discovery protocol for Infinispan
FROM quay.io/keycloak/keycloak:17.0.0 as builder
ENV KC_METRICS_ENABLED=true
ENV KC_FEATURES=preview
ENV KC_DB=postgres
ENV KC_HTTP_RELATIVE_PATH=/auth
# specify the custom cache config file here
ENV KC_CACHE_CONFIG_FILE=cache-ispn-jdbc-ping.xml
# copy the custom cache config file into the keycloak conf dir
@pedroigor
pedroigor / keycloakx-k8s.yaml
Last active August 5, 2022 14:00
Keycloak.X k8s spec
apiVersion: v1
kind: Service
metadata:
name: keycloak-postgres
labels:
service: keycloak
layer: security
spec:
ports:
- port: 5432
@eulerfx
eulerfx / Async.Race.fs
Created June 21, 2018 20:58
F# Async Race
let race (a:Async<'a>) (b:Async<'a>) : Async<'a * Async<'a>> = async {
return!
Async.FromContinuations <| fun (ok,err,cnc) ->
let state = ref 0
let iv = new TaskCompletionSource<_>()
let ok a =
if (Interlocked.CompareExchange(state, 1, 0) = 0) then
ok (a, iv.Task |> Async.AwaitTask)
else
iv.SetResult a
@jart
jart / blakefiler.py
Last active October 2, 2024 13:29
Turns bazel query --output=build //tensorflow:libtensorflow_framework.so into isomorphic Makefile
# Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
@romaninsh
romaninsh / lambda-vpc-internet-access-cloudformation.yml
Last active December 22, 2021 00:26
CloudFormation template implementing Private network which can be used by Serverless to deploy Lambda into VPCs an maintaining internet access
# Add the following to your existing VPC CF stack
# create 2 subnets, lambdas like to be in multiple subnets
Private1:
Type: AWS::EC2::Subnet
Properties:
VpcId: !Ref VPC
AvailabilityZone: !Select [ 0, !GetAZs ]
CidrBlock: !Ref Private1CIDR
@kekyo
kekyo / option.fs
Created July 3, 2017 23:51
F# option computation expression
[<Struct>]
type OptionalBuilder =
member __.Bind(opt, binder) =
match opt with
| Some value -> binder value
| None -> None
member __.Return(value) =
Some value
let optional = OptionalBuilder()
@danielrw7
danielrw7 / replify
Last active November 7, 2024 02:47
replify - Create a REPL for any command
#!/bin/sh
command="${*}"
printf "Initialized REPL for `%s`\n" "$command"
printf "%s> " "$command"
read -r input
while [ "$input" != "" ];
do
eval "$command $input"
printf "%s> " "$command"
@njlr
njlr / raleigh-frame-serial-numbering-system.md
Created August 9, 2016 14:34
The numbering system used for Raleigh bicycle frames

For Your Information: Frame Serial Numbering System

The location of our frame serial numbers will be on the top of the seat tube facing to the rear of the bicycle. This does not apply to models with 531 seat tubes which will be numbered under the bottom bracket. Markings show the source of manufacture, approximate date of manufacture and unique number of each frame manufactured in any 10 year cycle.

Size of letters and numbers 3/16" high, to match diameter of tubes. The complete stamp contains nine digits.

FIRST SYMBOL Denotes Location of Manufacture

Symbol | Location

@raulanatol
raulanatol / 01_websockets_nginx.config
Created April 12, 2016 08:27
Configure nginx to accept websockets on AWS Elastic Beanstalk
files:
"/etc/nginx/conf.d/01_websockets.conf":
mode: "000644"
owner: root
group: root
content: |
upstream nodejs {
server 127.0.0.1:8081;
keepalive 256;
}
@zhiguangwang
zhiguangwang / websocket-elb.md
Last active April 23, 2019 20:23
Configure websockets behind an AWS ELB.