Skip to content

Instantly share code, notes, and snippets.

View val314159's full-sized avatar

val314159 val314159

View GitHub Profile
@val314159
val314159 / create.js
Created March 21, 2022 23:11
create.js
const Web3 = require('web3');
let { API_URL, FROM, AMT } = process.env;
if(FROM[0]=='"')
FROM = FROM.substr(1,FROM.length-2);
const URL = API_URL || "ws://localhost:8546";
const web3 = new Web3(URL);
web3.eth.accounts.wallet.create(3, '54674321§3456764321§345674321§3453647544±±±§±±±!!!43534534534534');
async function send2(from, address, amt) {
const nonce = await web3.eth.getTransactionCount(from, 'latest'); // nonce starts counting from 0
const transaction = {
@val314159
val314159 / %filter.py
Last active August 22, 2020 13:21
karabiner json, stick this in ~/.config/karabiner/assets/complex_modifications/keys.json
#!/usr/bin/env python3
import os, sys
from sys import argv
from os import system
prog = argv.pop(0)
frst = argv.pop(0)
last = argv.pop()
system('cat '+frst)
for fn in argv:
system('cat '+fn)
@val314159
val314159 / .README.md
Last active July 4, 2020 05:41
red-black trees
We couldn’t find that file to show.
all: ; sbcl --script test.lisp
@val314159
val314159 / Makefile
Last active January 1, 2020 02:35 — forked from kylemcdonald/three.js.shader.html
Minimal three.js shader example.
all:
open three.js.shader.html
combobulate:
sbcl --script $*.lisp
ecl -load $*.lisp -eval '(quit)'
ccl64 --load $*.lisp --eval '(quit)'
@val314159
val314159 / normalize.lisp
Last active September 6, 2019 01:19
normalize lisp syntax
#| -*- lisp -*-
exec sbcl --script $0 $* # |#
;;≈ç√Ωπøπøˆøˆˆ©ƒ√∂
(set-dispatch-macro-character
#\# #\/ (lambda(stream subchar arg)
(declare (ignore subchar arg))
(list (quote quote) (read stream t nil t))))
(defun concat(&rest r) (apply #'concatenate #/string r))
(import #/(sb-impl::quasiquote sb-impl::unquote-splice
sb-impl::unquote-nsplice sb-impl::unquote))
@val314159
val314159 / +README.md
Created December 9, 2018 19:21 — forked from quiver/README.md
Who says PostgreSQL can't Pub/Sub like Redis?

Pub/Sub pattern with PostgreSQL's LISTEN/NOTIFY command

This is a simple chat-like program using pub-sub pattern, backed by PostgreSQL's LISTEN/NOTIFY command.

Publish

publish message to foo channel from user nickname.

$ python pub.py foo nickname
PUBLISH to channel #foo
@val314159
val314159 / Dockerfile
Created October 19, 2018 23:31
emscripten Dockerfile, slightly updated
FROM buildpack-deps:bionic
RUN apt-get -y update && apt-get -y upgrade && apt-get -y install apt-utils
SHELL ["/bin/bash", "-c"]
ENV DEBIAN_FRONTEND=noninteractive LANG=C.UTF-8
RUN mkdir -p /root/emscripten/
COPY emscripten /root/emscripten/
RUN cd /root/ \
@val314159
val314159 / Makefile
Created October 18, 2018 04:25
Let's get explicit
PROG=hi
all: test
test: $(PROG) ; ./$(PROG)
clean: ; rm -fr *.{o,a,so} *~ $(PROG)
hi: hi.o
$(LD) $(LDFLAGS) $^ -o $@
hi.o: hi.c
$(CC) $(CFLAGS) -c $^ -o $@