Skip to content

Instantly share code, notes, and snippets.

View Richard-Degenne's full-sized avatar
🍻
Thirsty!

Richard Degenne Richard-Degenne

🍻
Thirsty!
View GitHub Profile
@Leonidas-from-XIV
Leonidas-from-XIV / ghget.sh
Created March 20, 2019 12:45
OPAMFETCH for private archives
#!/usr/bin/env bash
#
# Adapted and fixed from https://gist.github.com/josh-padnick/fdae42c07e648c798fc27dec2367da21
#
# This is an adaptation of code I wrote to download a private binary from GitHub. Such...pain.
# Why can't GitHub just offer a standardized URL you can download a release binary from and attach
# your Github Personal Access Token as a header?
#
# Since this code is an adaptation it hasn't been directly tested, but the code it was adapted from works
# and hopefully you can get the missing piece you're after by looking here.
@magicdude4eva
magicdude4eva / zsh-syntax-highlighting paste performance improvement
Last active June 12, 2024 22:37
zsh-syntax-highlighting paste performance improvement
Add the following in .zshrc:
...
plugins=(osx git zsh-autosuggestions zsh-syntax-highlighting zsh-nvm docker kubectl)
...
### Fix slowness of pastes with zsh-syntax-highlighting.zsh
pasteinit() {
OLD_SELF_INSERT=${${(s.:.)widgets[self-insert]}[2,3]}
zle -N self-insert url-quote-magic # I wonder if you'd need `.url-quote-magic`?
@komamitsu
komamitsu / myecho.ml
Created November 13, 2011 14:14
a Lwt echo server for practice
(* ocamlfind c -w A -linkpkg -package lwt,lwt.unix,lwt.syntax -syntax camlp4o,lwt.syntax myecho.ml -o myecho *)
(* This code refers to https://github.com/avsm/ocaml-cohttpserver/blob/master/server/http_tcp_server.ml *)
open Lwt
let server_port = 12345
let so_timeout = Some 20
let backlog = 10
let try_close chan =
catch (fun () -> Lwt_io.close chan)