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.
@val314159
val314159 / EXAMPLE.md
Last active April 26, 2020 04:54
tensorflow example

Tensorflow example

cd $HOME
mkdir workspace
cd workspace
git clone http://github.com/tensorflow/tensorflow
git clone http://github.com/tensorflow/models
cd tensorflow/tensorflow/models/image/imagenet
python classify_image.py
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 / makex
Last active October 20, 2018 00:43
make utility
#!/usr/bin/env python
import os, sys
while 1:
if 'Makefile' in os.listdir('.'):
os.execlp('make', *sys.argv)
elif os.path.realpath('.') == '/':
raise SystemExit("Error: '%s' Not Found" % Makefile)
os.chdir('..')