Skip to content

Instantly share code, notes, and snippets.

View zv's full-sized avatar
💭
FOLLOWS YOU

zv zv

💭
FOLLOWS YOU
View GitHub Profile
@caldwell
caldwell / .gitconfig
Last active November 22, 2020 20:21
~/.gitconfig snippet for using Emacs ediff with git mergetool via emacsclient.
[merge]
tool = ediff
[mergetool "ediff"]
cmd = emacsclient -c -a \"\" --eval \"(ediff-merge-files-with-ancestor \\\"$LOCAL\\\" \\\"$REMOTE\\\" \\\"$BASE\\\" nil \\\"$MERGED\\\")\"

I just learned that service workers are finally getting to the state where JavaScript in the browser can handle HTTP requests browser-side!

A couple years ago, I was working on making a web ide that used git in the browser to sync and edit code entirely offline in any browser. Using appcache manifest I was able to even make the page reload offline. Data was stored in local storage and indexed db.

There was one major flaw though. I had no reasonable way to run the code. Sure I could eval some JavaScript snippets or even run them in a web worker (dynamically creating worker urls from blobs from user text). But what I really wanted and couldn't do was service HTTP requests and develop a web app in the browser.

So here's the basic idea for the next generation of tedit:

  • Command line for primary interface, will have smart auto-completion, suggestions, inline help links and syntax highlighting. But it will be a command line!
  • Apps can be launched from the command line. There will be a text editor wid
@zv
zv / cvim.vim
Last active June 6, 2018 21:50
CVim Configuration
let hintcharacters = "alskierudjfhg"
" let hintcharacters = ";ghrueiwotlaskdjf"
" let hintcharacters = "gh;aureiwozxtyqpmnkdlsfj"
" let hintcharacters = "dsaghweruiocjklf"
let blacklists = ["https://groups.google.com/*","https://www.hackerrank.com/*","https://twitter.com/*"]
let qmark r = "https://reddit.com"
let qmark t = "https://twitter.com"
let qmark b = ["http://localhost:4000"]
command blog tabnew http://localhost:4000
let qmark w = ["http://localhost:8080"]
@zv
zv / all_128.smt
Last active October 6, 2017 23:26
Find MD4 fixed points with with less thab 2^(128/2)/16 decisions & conflicts!
(set-logic QF_BV) ; remove this line if you haven't patched z3 to incl. ext_rotate_left in QF_BV
(set-info :source |
NOiSE BRiDGE HASHSMASH KREW
solve md4(x) == x
author zv <zv@nxvr.org>
|)
(set-info :smt-lib-version 2.0)
(set-info :status unknown)
;; We are seeking a valid assignment of the 4 32-bit literals (named 'ch_$N')
@pvik
pvik / smartparens-cheatsheet.md
Last active March 17, 2024 03:29
A Cheatsheet for Emacs Smarparens example configuration

An animated cheatsheet for smartparens using the example configuration specified here by the smartparens author. Inspired by this tutorial for paredit.

Traversal

C-M-f sp-forward-sexp
C-M-b sp-backward-sexp
@creationix
creationix / rpc.md
Last active December 30, 2020 03:58
Simple RPC design

I've designed a lot of RPC protocols in my career. One pattern that's worked well basically goes as follows:

// Client calls: print('Hello World\n')
-> [1, "print", "Hello World!\n"]
// Server sends return value (or lack of return vvalue)
<- [-1]

// Client calls: add(1, 2)
-> [2, "add", 1, 2]