Skip to content

Instantly share code, notes, and snippets.

Avatar

Dominic Tarr dominictarr

View GitHub Profile
View index.html
<canvas width=800 height=600></canvas>
<script>
var id
var mem = new Uint8ClampedArray(1024*1024 * 4)
function resize () {
canvas.width = window.innerWidth
canvas.height = window.innerHeight
id = new ImageData(mem.slice(0, canvas.width*canvas.height*4), canvas.width, canvas.height)
View index.html
<canvas width=800 height=600></canvas>
<script>
var id
var mem = new Uint8ClampedArray(1024*1024 * 4)
function resize () {
canvas.width = window.innerWidth
canvas.height = window.innerHeight
id = new ImageData(mem.slice(0, canvas.width*canvas.height*4), canvas.width, canvas.height)
View everything-is-expression.wat
(module
(func (export "foo") (param $foo i32) (result i32)
(local $x i32)
;;if blocks (if, block, loop, etc) have a (result x) then they return a value!
(if (result i32) (local.get $foo)
(if (result i32)
(i32.gt_s (local.get $foo) (i32.const 10))
(i32.const 10)
(block (result i32) (i32.const 1))
)
View wc.lisp
(module
(def ints (import "acid-ints"))
(def mem (import "acid-memory"))
(def strings (import "acid-strings"))
(def read_request (system "system" "read_request" (id start bytes)))
(def write_ready (system "system" "write_ready" (id start bytes)))
(def open_request (system "system" "open_request" (id start bytes)))
;;HACK: global in main mem, TODO global vars
View parse.al
(module
(def strings (import "./strings"))
(def _match (mac R (str i) (block
(def len (strings.length str))
(if (eq i (sub len 1))
&(if (eq (strings.at input (add start $i)) $(strings.at str i)) len -1)
&(if (eq (strings.at input (add start $i)) $(strings.at str i))
(R $str $(add 1 i)) -1)
)
View bench.lisp
(module
;; an operation defined inside a macro
(def op_mac (mac (a b) (block
&[i32_load (mod a 1000)]
)))
;;a function that contains that macro
(def op_fun (fun (a b) (op_mac a b) ))
(def N 10000000)
@dominictarr
dominictarr / aggregate-help.js
Created Dec 2, 2019
aggregate muxrpc-usage help
View aggregate-help.js
module.exports = function (sbot, cb) {
var help = null
sbot.help(function (err, data) {
if(!data.type) data.type = 'group'
help = data
var keys = Object.keys(sbot)
var n = keys.length + 1
keys.forEach(function (key) {
if(sbot[key] && 'function' === typeof sbot[key].help)
sbot[key].help(function (err, data) {
@dominictarr
dominictarr / readme.md
Created Nov 26, 2018
statement on event-stream compromise
View readme.md

Hey everyone - this is not just a one off thing, there are likely to be many other modules in your dependency trees that are now a burden to their authors. I didn't create this code for altruistic motivations, I created it for fun. I was learning, and learning is fun. I gave it away because it was easy to do so, and because sharing helps learning too. I think most of the small modules on npm were created for reasons like this. However, that was a long time ago. I've since moved on from this module and moved on from that thing too and in the process of moving on from that as well. I've written way better modules than this, the internet just hasn't fully caught up.

@broros

otherwise why would he hand over a popular package to a stranger?

If it's not fun anymore, you get literally nothing from maintaining a popular package.

One time, I was working as a dishwasher in a restu

View url-encoded-links.js
View output.txt
{ '@DTNmX+4SjsgZ7xyDh5xxmNtFqa6pWi5Qtw7cE8aR9TQ=.ed25519': 'wx.larpa.net:8008:@DTNmX+4SjsgZ7xyDh5xxmNtFqa6pWi5Qtw7cE8aR9TQ=.ed25519',
'@D0GsAaMyt96Ze3q1YiiuzWhPkyou2fVTUgw8Xr+G7Jo=.ed25519': '9ithub.com:8008:@D0GsAaMyt96Ze3q1YiiuzWhPkyou2fVTUgw8Xr+G7Jo=.ed25519',
'@dBQlwh9Gtr3i5YMOGtIOKtGNVepeu+nyb6KGl1vtOcM=.ed25519': 'sp9.solarpunk.dk:8008:@dBQlwh9Gtr3i5YMOGtIOKtGNVepeu+nyb6KGl1vtOcM=.ed25519',
'@SP4xNZmDsOuRrjDS6NCcmr3xoieXQOMPBQ4TkUHSJ2M=.ed25519': 'sp4.solarpunk.dk:8008:@SP4xNZmDsOuRrjDS6NCcmr3xoieXQOMPBQ4TkUHSJ2M=.ed25519',
'@BzMp3eRNjPUonwRd/0loT3KaRKIMFx7ZOZQE1F+XDug=.ed25519': 'sbot.ktorn.com:8008:@BzMp3eRNjPUonwRd/0loT3KaRKIMFx7ZOZQE1F+XDug=.ed25519',
'@eM4e8pmRiZpeCBitqp6vq3lT8EwC5UjjKuajHbpWnNI=.ed25519': '198.199.97.80:8008:@eM4e8pmRiZpeCBitqp6vq3lT8EwC5UjjKuajHbpWnNI=.ed25519',
'@YXquIbh1OqCCdMuqCO4tSJuYR7RL811CTuu59n7G0pk=.ed25519': 'post.tableflip.io:8008:@YXquIbh1OqCCdMuqCO4tSJuYR7RL811CTuu59n7G0pk=.ed25519',
'@nSCVHJ5OSajcynWgo3Xh0bChZN3e4oV1ooIuFWdxrmg=.ed25519': 'hub.devcontr
You can’t perform that action at this time.