Skip to content

Instantly share code, notes, and snippets.

@SomeHats
SomeHats / runDevBrowser.mjs
Last active February 26, 2025 16:13
A hacky local version of cloudflare's browser rendering API. To use this, copy either runDevBrowser.ts or runDevBrowser.mjs and install the puppeteer and ws packages from npm. Run the dev server alongside wranger with `node runDevServer.mjs` or `tsx runDevServer.ts`
/* eslint-disable no-console */
/***
* This is a little server that emulates the protocol used by cloudflare's browser rendering API. In
* local development, you can run this server, and connect to it instead of cloudflare's (strictly
* limited) API. e.g. in your worker you might use a function like this:
*
* ```ts
* import { Browser, launch as launchPuppeteer } from '@cloudflare/puppeteer'
* function launchBrowser(env: Environment) {
* if (env.LOCAL_BROWSER_ORIGIN) {
@ozanmakes
ozanmakes / keymap.json
Created June 17, 2023 19:29
Emacs keybindings for Zed (work in progress)
[
{
"bindings": {
"ctrl-g": "menu::Cancel",
"ctrl-x o": "workspace::ActivateNextPane",
"ctrl-tab": "pane::ActivateNextItem",
"ctrl-shift-tab": "pane::ActivatePrevItem"
}
},
{
@wokalski
wokalski / Ppx_driver_with_bucklescript.md
Created August 26, 2019 07:38
How to run a driver based ppx with bucklescript
  1. Create a dune file:
(library
 (public_name aggregate_ppx_name)
 (kind ppx_rewriter)
 (libraries ppx_deriving_protobuf other_ppx another_ppx))
  1. Build:
dune build --profile release
@zehnpaard
zehnpaard / dune
Created June 10, 2019 09:31
OCaml template for menhir/ocamllex/dune indentation-aware parser
(menhir
(modules parser))
(ocamllex lexer)
(executable
(name ex))
@ianfixes
ianfixes / README.md
Last active March 9, 2022 21:36
New Relic Swagger 2.0 (OpenAPI spec) for generating clients and documentation
@rizo
rizo / Dockerfile
Last active January 30, 2020 10:22
Dockerfile for esy projects.
# Build image
FROM node:10.13-alpine as build
# Prepare the environment to install esy.
RUN apk add --no-cache \
ca-certificates wget \
bash curl perl-utils \
git patch gcc g++ musl-dev make m4
@chrisdone
chrisdone / readme.md
Last active December 7, 2023 16:10
Idea: A web frontend for Emacs via CodeMirror

Idea: A web frontend for Emacs via CodeMirror

This is a discussion/thought-process document with my ideas that I've been adding to recently.

Motivation

Why a web frontend for Emacs?

  1. A web frontend would benefit from being cross-platform in the sense
@sgrove
sgrove / curl_async.ml
Last active February 11, 2019 12:24
Bad interaction between Async wrapper around ocurl and httpaf
[@@ocaml.doc " Async support for Curl, see https://github.com/ygrek/ocurl/blob/master/curl_lwt.ml "]
module M = Curl.Multi
type interrupt = unit Async.Ivar.t
type multi =
{
mt: Curl.Multi.mt ;
all_events: (Unix.file_descr, interrupt list) Hashtbl.t ;
wakeners: (Curl.t, Curl.curlCode Async.Ivar.t) Hashtbl.t }
@huytd
huytd / customize.material-dark-theme.md
Last active September 2, 2023 13:03
My minimal Emacs config

;; Automatically generated
(custom-set-variables
 ;; custom-set-variables was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 '(anzu-cons-mode-line-p nil)