Skip to content

Instantly share code, notes, and snippets.

@secwang
secwang / repl.apl
Created March 16, 2024 02:42
repl.apl
#!/usr/bin/env dyalogscript ENABLE_CEF=0
∇ repl
:Repeat
⍝ Read
input ← ⍞
⍝ Eval & Print
:Trap 0
result ← ⍎input
@secwang
secwang / a.apl
Created December 3, 2023 20:44
camp sh and http command
hc ← ⎕SE.SALT.Load'HttpCommand'
a ← {hc.Get 'https://api.kanye.rest/'}
b←{⎕sh 'curl -s "https://api.kanye.rest/"'}
)copy dfns cmpx
cmpx 'a 0' 'b 0'
a 0 → 1.3E0 | 0% ⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕
* b 0 → 1.1E0 | -18% ⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕
@secwang
secwang / gad.sh
Created December 14, 2022 08:04
generate eth paper wallet
#!/usr/bin/env bash
#brew install sha3sum
# Generate the private and public keys
openssl ecparam -name secp256k1 -genkey -noout | openssl ec -text -noout > key
# Extract the public key and remove the EC prefix 0x04
cat key | grep pub -A 5 | tail -n +2 | tr -d '\n[:space:]:' | sed 's/^04//' > pub
# Extract the private key and remove the leading zero byte
cat key | grep priv -A 3 | tail -n +2 | tr -d '\n[:space:]:' | sed 's/^00//' > priv
# Generate the hash and take the address part
cat pub | keccak-256sum -x -l | tr -d ' -' | tail -c 41 | awk '{print "0x"$1}'> address
{"sig":"83e30d080df5810d7965ff6cdee5df83c0676ab76ba7cf4f4a9f29cc23af18372ed4df0e7f6c5a51398245b0abb281925e4aa595714d95200f41896e89ed08440","msghash":"62f568f0877066fdf2d9772da39f4959b5586ff94971bbde028a82d829c1cc29"}

Keybase proof

I hereby claim:

  • I am secwang on github.
  • I am secwang (https://keybase.io/secwang) on keybase.
  • I have a public key whose fingerprint is 6117 95D7 5933 5BB6 6611 825F 6769 CAE6 04BC DB1E

To claim this, I am signing this object:

@secwang
secwang / target.md
Last active December 26, 2017 06:59
target why when done review
学习如何赚币 赚钱容易赚币难
learn gnu cash to manage investment 我的生活里缺少报表
leetcode c++ 我希望成为一个更加厉害的程序员
eos project eos will grow
my invest principles 整理中
toefl 我希望成为一个专业的双语使用者
grammar book 语法必须学
daily writing and speaking 笨办法学英语
@secwang
secwang / FAQ.txt
Last active October 4, 2017 08:20
- 目标管理见桌面上的文件
* 常给自己写说明书是个好习惯
* 临时工作文件放在 ~/TMP 文件夹,console tmp
* 勤归档
* 想做的任务使用 trello 管理,things 做具体的gtd,每日归档见dayone,写作归档见bear
* 单词使用手册?
* 了解很多的道理但是过不好这一生是为什么。就是重复的次数不够。
* 了解正确道理,但是生活没有真的改变。第一不是笃信,第二没有践行
* 困惑焦虑是平台期的正常反应,熟悉已被告诉是错误,新的舒适尚未到来,坚持一下就好,在平台期需要反直觉的前行
* 不要怕麻烦,怕麻烦的人一事无成
xxx.class.getProtectionDomain().getCodeSource()
#!/usr/bin/env perl
use strict;
use warnings;
use utf8::all;
sub trim
{
my $string = shift;
$string =~ s/^\s+//;