This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use axum::{extract::ConnectInfo, response::Html, routing::get, Router}; | |
use axum_server::tls_openssl::OpenSSLConfig; | |
use openssl::ssl::{SslAcceptor, SslFiletype, SslMethod, SslVerifyMode}; | |
use openssl::x509::{ | |
store::{X509Store, X509StoreBuilder}, | |
X509, | |
}; | |
use std::{net::SocketAddr, path::PathBuf}; | |
#[tokio::main] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
After setting up the project. | |
Adding: | |
{ | |
"javascript.validate.enable": false, | |
"flow.useNPMPackagedFlow": true | |
} | |
to the .vscode/settings.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#lang typed/racket | |
;; (normalize-range (list (range 1 2) (range 3 4) (range 4 83) (range 0 0) (range 1 6))) | |
(struct range ([from : Integer] [to : Integer]) #:transparent) | |
(: to-integer (-> String Integer)) | |
(define (to-integer str) | |
(assert (string->number str) exact-integer?)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(* | |
* ocamlfind ocamlc -package containers -linkpkg rangemerge.ml | |
*) | |
open Containers | |
open Printf | |
let normalize_range ranges = | |
List.sort (fun x y -> compare (fst x) (fst y)) ranges | |
|> List.fold_left (fun acc x -> | |
let src = List.hd acc in |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Input example: 1,2,8-20,15-200 | |
* Output: 1,2,8-200 | |
*/ | |
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
namespace Fold |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Windows automatic proxy settings resolver | |
* Jiri Hruska <jirka@fud.cz>, 2012-2013 | |
* Released under the WTFPL license. */ | |
#define UNICODE | |
#define _UNICODE | |
#include <string> | |
#include <Windows.h> | |
#include <winhttp.h> | |
#pragma comment(lib, "winhttp.lib") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
setlocal | |
set OPEN_DYLAN_USER_ROOT=%CD%\_build | |
dylan-compiler-with-tools -build %1.lid |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Using Core.Std in Emacs | |
======================= | |
merlin | |
------ | |
When you want to use external libraries installed with opam (findlib?). | |
You could do it by using `merlin-use` command, it will prompt you for a package name. | |
For example, we need to use Std.Core: | |
M-x merlin-use |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
location ~* ^/who/.*\.(js|jpg|jpeg|css ... others ...)$ { | |
root /var/www/who/public; | |
rewrite ^/who/?(.*)$ /$1 break; | |
try_files $uri =404; | |
expires max; | |
access_log off; | |
} | |
location ^~ /who { |