Skip to content

Instantly share code, notes, and snippets.

View kaosf's full-sized avatar
🏠
Working from home

ka kaosf

🏠
Working from home
View GitHub Profile
@kaosf
kaosf / mattn-token-info.txt
Created October 21, 2023 17:18
MATTN token information
View mattn-token-info.txt
On Polygon network only
Contract address: `0xc8f48E2b873111aA820463915b3a637302171d61`
Total supply: 5,000,000,000,000,000
Total supply (ja): 5000兆
QuickSwap
MATTN-MATIC pair: https://quickswap.exchange/#/swap?swapIndex=0&currency0=ETH&currency1=0xc8f48E2b873111aA820463915b3a637302171d61
@kaosf
kaosf / erc20.sol
Created October 20, 2023 16:25
ERC20 note
View erc20.sol
pragma solidity ^0.6.0;
interface tokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes calldata _extraData) external; }
contract TokenERC20 {
string public name;
string public symbol;
uint8 public decimals = 18;
uint256 public totalSupply;
@kaosf
kaosf / nostr-rabbit-dark-theme.css
Last active September 21, 2023 09:27
My Dark Theme CSS for Rabbit (one of Nostr client)
View nostr-rabbit-dark-theme.css
body {
background-color: #202732;
color: #c7c7c7;
}
a {
color: #7770f0;
}
a:visited {
color: #aaaaee;
}
@kaosf
kaosf / how-to-run-bitcoind-with-tor.md
Created July 7, 2023 05:30
How to run `bitcoind` with systemd and Tor
View how-to-run-bitcoind-with-tor.md

On Arch Linux.

sudo pacman -S bitcoin-daemon tor

sudo systemctl enable tor.service
sudo systemctl start tor.service

Create /etc/systemd/system/bitcoin.service.

@kaosf
kaosf / index.js
Created July 4, 2023 14:26
Nostr backup experimental code version 20230704
View index.js
// ka's nostr backup experimental code version 20230704
const WebSocketClient = require("websocket").client;
const client = new WebSocketClient();
client.on('connectFailed', function(error) {
console.log('Connect Error: ' + error.toString());
});
@kaosf
kaosf / aikatsup.ts
Created May 26, 2023 15:24
AikatsUP search core by TypeScript
View aikatsup.ts
import * as fs from "fs";
import * as path from "path";
import { parse } from "csv-parse/sync";
import * as crypto from "crypto";
import * as http from "http";
import * as https from "https";
const filepath = path.join(__dirname, "aikatsup20230422.csv");
const expected_sha256 =
"14648f557a2ad394b513c0800afd3b1f4d1ee23964f501820a392cb6779a9a19";
View aikatsup.ts
const [keyword, type] = ["大空あかり", "キャラ"];
// const [keyword, type] = ["穏やかじゃない", "セリフ"]
import * as fs from "fs";
import * as path from "path";
import { parse } from "csv-parse/sync";
const source = path.join(__dirname, "aikatsup20230422.csv");
const buffer = fs.readFileSync(source);
const rows = parse(buffer, { relax_column_count: true }) as string[][];
@kaosf
kaosf / aikatsup-characters.txt
Created May 26, 2023 11:36
AikatsUP characters list
View aikatsup-characters.txt
星宮いちご
霧矢あおい
紫吹蘭
有栖川おとめ
藤堂ユリカ
北大路さくら
一ノ瀬かえで
神谷しおん
音城セイラ
冴草きい
@kaosf
kaosf / aikatsup.rb
Created May 26, 2023 11:21
AikatsUP search core by Ruby
View aikatsup.rb
require "digest"
require "open-uri"
FILEPATH = "./aikatsup20230422.csv"
EXPECTED_SHA256 = "14648f557a2ad394b513c0800afd3b1f4d1ee23964f501820a392cb6779a9a19"
def download_from_github_and_succeeded
URI.open("https://raw.githubusercontent.com/kaosf/AikatsuDOWN/master/data/aikatsup20230422.csv") do |file|
File.open(FILEPATH, 'wb') do |output|
output.write(file.read)
@kaosf
kaosf / sakura-cloud-shell-experiment.sh
Created May 26, 2023 04:54
Install Rust, Build AikatsuDOWN, and Run it; Experiment on Sakura Cloud Shell (ref. https://www.sakura.ad.jp/services/cloudshell/)
View sakura-cloud-shell-experiment.sh
tmux
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source .cargo/env
sudo apt install tig
git clone https://github.com/kaosf/AikatsuDOWN
cd AikatsuDOWN
git checkout no-deps