Skip to content

Instantly share code, notes, and snippets.

@HelloRWA
HelloRWA / mini-ao-full-stack.md
Last active April 2, 2024 13:03
Five minutes to make an AO Full Stack App

Five minutes to make an AO Full Stack App

Video Tutorial

1. init nuxt project

npx nuxi init -t github:nuxt-ui-pro/saas ao-full-stack
pnpm i @permaweb/aoconnect @vue-macros/nuxt
@bluelovers
bluelovers / ChatGPT Stable Diffusion prompts generator.txt
Last active April 16, 2024 03:22
using ChatGPT as Stable Diffusion prompts generator
Stable Diffusion is an AI art generation model similar to DALLE-2.
Here are some prompts for generating art with Stable Diffusion.
Example:
- A ghostly apparition drifting through a haunted mansion's grand ballroom, illuminated by flickering candlelight. Eerie, ethereal, moody lighting.
- portait of a homer simpson archer shooting arrow at forest monster, front game card, drark, marvel comics, dark, smooth
- pirate, deep focus, fantasy, matte, sharp focus
- red dead redemption 2, cinematic view, epic sky, detailed, low angle, high detail, warm lighting, volumetric, godrays, vivid, beautiful
- a fantasy style portrait painting of rachel lane / alison brie hybrid in the style of francois boucher oil painting, rpg portrait
#!/usr/bin/env python3
import bitarray
from hashlib import blake2b
# POW Constants
BASE_EDGE_BITS = 24
PROOFSIZE = 42;
# https://github.com/mimblewimble/grin/blob/cccaf984936d4792f8b6c39e6b500ad2e3f08817/core/src/pow/types.rs#L314
@fragosti
fragosti / test.js
Created March 20, 2020 15:27
Posting order code
const connect = require('@0x/connect');
const subproviders = require('@0x/subproviders');
const utils = require('@0x/utils');
const wrapper = require('@0x/web3-wrapper');
const orderUtils = require('@0x/order-utils');
const contractAddresses = require('@0x/contract-addresses');
const handler = {
onUpdate: (...args) => console.log('onUpdate:', ...args),
onError: (...args) => console.log('onError:', ...args),
onClose: (...args) => console.log('onClose:', ...args),
@DavidBurkett
DavidBurkett / OneSidedMWTxs.md
Last active December 17, 2020 01:38
Offline Transactions in Mimblewimble

Offline Transactions in Mimblewimble

Mimblewimble is a blockchain protocol that improves on bitcoin's privacy and scalability by using pedersen commitments, schnorr signatures, and a novel technique called 'cut-through'. These benefits have come at a steep cost. Building transactions have thus far required interaction between the sender and receiver to create the outputs and collectively sign the transaction. We present here a method of achieving one-sided transactions while minimizing the impact on the scalability and privacy of mimblewimble.

Current Protocol

Like bitcoin, Grin uses a UTXO model. Transactions are created by including inputs to spend, creating new outputs of equal or lesser value, and signing and building rangeproofs to verify ownership of the inputs.

Unlike bitcoin, Grin uses confidential transactions, so the inputs and outputs are pedersen commitments (r*G + v*H). Instead of the signatures being added to the inputs, there is only one signature per transaction, which is part of the

@bladedoyle
bladedoyle / gist:421d3f508945bdf59c93d515ee420fc9
Last active October 10, 2019 14:41
grin share value notes
Pool finds block 4300 - https://grinscan.net/block/4300
Secondary scale = 529
scale = factor = Scaling difficulty =
for primary pow (cuckatooN solution) where N>=31 = 2^(1+EDGEBITS-24)*N
for secondary pow - (cuckatoo29 solution) = variable, retargeted every block, stored as header field "secondary_scaling"
Example: Three workers contributed shares:
Worker A submitted 50 cuckaroo29 shares
Worker B submitted 25 cuckaroo29 shares and
@nakov
nakov / secp256k1-example.js
Last active April 9, 2024 16:32
ECDSA in JavaScript: secp256k1-based sign / verify / recoverPubKey
let elliptic = require('elliptic');
let sha3 = require('js-sha3');
let ec = new elliptic.ec('secp256k1');
// let keyPair = ec.genKeyPair();
let keyPair = ec.keyFromPrivate("97ddae0f3a25b92268175400149d65d6887b9cefaf28ea2c078e05cdc15a3c0a");
let privKey = keyPair.getPrivate("hex");
let pubKey = keyPair.getPublic();
console.log(`Private key: ${privKey}`);
console.log("Public key :", pubKey.encode("hex").substr(2));
@bretton
bretton / improved-lnd-bitcoind-mainnet.md
Last active May 13, 2024 14:23
Detailed guide to installing LND and Bitcoind on Ubuntu 16.04 LTS for Mainnet

Intro

This guide is specific to getting LND 0.5-beta and Bitcoind running on Ubuntu 16.04 LTS for mainnet. It is aging rapidly and includes steps not necessary on newer versions of LND. As of April 2021 it is very out of date for bitcoind. As of December 2021 it is outdated for LND too.

Original installation guide:

This guide is broken into the following sections:

  • Install bitcoind and set to start automatically
  • Install development tools and dependancies
@parshap
parshap / node-modules-in-react-native.md
Last active November 15, 2023 11:15
Running Node Modules in React Native

Running Node Modules in React Native

How to use packages that depend on Node.js core modules in React Native.

See the [node-libs-react-native][node-libs-react-native] library as a convenience for implementing this method.

Node.js Core Modules

@jaysonsantos
jaysonsantos / main.rs
Last active April 29, 2024 15:16
rust ring example
extern crate ring;
use ring::aead::*;
use ring::pbkdf2::*;
use ring::rand::SystemRandom;
fn main() {
// The password will be used to generate a key
let password = b"nice password";