Skip to content

Instantly share code, notes, and snippets.

import React, { useEffect, useState } from "react"
function useMpurse() {
const [mpurse, setMpurse] = useState(null);
const [addr, setAddr] = useState(null);
useEffect(() => {
if (mpurse === null) {
const mp = window.mpurse;
if (mp) {
setMpurse(mp);
import React, { useState } from "react"
import NodeRSA from "node-rsa"
function generateKeyPair(bits){
const key = new NodeRSA({b: bits});
const pri = key.exportKey('pkcs1-private-der');
const pub = key.exportKey('pkcs1-public-der');
return [pub, pri];
}
import React, { useState } from "react"
import sss from "sss-wasm"
export default function UpImage(props) {
const [msg, setMsg] = useState('');
const [shares, setShares] = useState('');
const [amount, setAmount] = useState(5);
const [threshold, setThreshold] = useState(4);
function msgChanged(ev) {
import React, { useState } from "react"
const writeableNodes = [
//'http://127.0.0.1:8080/ipfs/',
'https://ipfs.eternum.io/ipfs/',
'https://jacl.tech/ipfs/',
];
const publicNodes = [
//'http://127.0.0.1:8080/ipfs/',
import React, { useState } from "react"
const writeableNodes = [
'https://ipfs.eternum.io/ipfs/',
'https://jacl.tech/ipfs/',
'/ipfs/',
'http://127.0.0.1:8080/ipfs/',
];
const publicNodes = [
@ohac
ohac / monaparty.js
Created December 21, 2020 13:49
Monaparty asset image React component
import React from "react"
class Monaparty extends React.Component {
constructor(props) {
super(props)
this.state = {
url: null
}
}
@ohac
ohac / monacard.js
Created December 20, 2020 14:36
React component for Monacard API
import React from "react"
class Monacard extends React.Component {
constructor(props) {
super(props)
this.state = {
url: null
}
}
@ohac
ohac / .gitignore
Last active August 23, 2020 20:02
get file ID from Panasonic Lumix DMC-GX8
result.xml
tmp.xml
tmp2.txt
*.jpg
*.mp4
*.ts

linux側

ffmpeg -f jack -i "win" -ac 2 -acodec pcm_s16le -ar 44100 \
  -f s16le "udp://172.21.62.122:18181"

windows側

ffplay -nodisp -ac 2 -acodec pcm_s16le -ar 44100 -analyzeduration 0 \
  -probesize 32 -f s16le -i udp://0.0.0.0:18181?listen=1
@ohac
ohac / govanity.diff
Created June 8, 2020 08:54
use sha256sum as private key
diff --git a/generate.go b/generate.go
index 6fa11d6..9cff58f 100644
--- a/generate.go
+++ b/generate.go
@@ -2,8 +2,10 @@ package main
import (
"crypto/rand"
+ "crypto/sha256"
"flag"