Skip to content

Instantly share code, notes, and snippets.

View Dolu89's full-sized avatar
🎯
Focusing

Dolu Dolu89

🎯
Focusing
View GitHub Profile
@staab
staab / survey.md
Last active April 27, 2024 05:04
A survey of Nostr DM proposals

This is an attempt to take a step back and summarize all proposed approaches to private messages (DMs, group chats, and general-purpose nostr-within nostr, including for large groups of people) for the purpose of building a secure, feature-complete, interoperable solution.

This topic has come up repeatedly over nostr's history, and has entered the limelight again because of HRF's e2e encrypted group chats bounty. The hope here is to get everyone on the same page and hammer out one or more NIPs that can incorporate the best parts of all proposed solutions so we can finally get secure messaging on nostr.

Please comment with thoughts, criticisms, missing proposals/implmentations, and I will update the gist as we go along.

Proposals Reference

@junderw
junderw / getByteCount.js
Last active April 19, 2024 07:02
Estimate bytes for bitcoin transactions
// Usage:
// getByteCount({'MULTISIG-P2SH:2-4':45},{'P2PKH':1}) Means "45 inputs of P2SH Multisig and 1 output of P2PKH"
// getByteCount({'P2PKH':1,'MULTISIG-P2SH:2-3':2},{'P2PKH':2}) means "1 P2PKH input and 2 Multisig P2SH (2 of 3) inputs along with 2 P2PKH outputs"
function getByteCount(inputs, outputs) {
var totalWeight = 0
var hasWitness = false
var inputCount = 0
var outputCount = 0
// assumes compressed pubkeys in all cases.
var types = {
@AlwaysBCoding
AlwaysBCoding / CoinFlipOracle.sol
Created February 19, 2017 03:47
Ethereum Ðapp Development - Video 12 | Oracles and Oraclize
pragma solidity ^0.4.0;//please import oraclizeAPI_pre0.4.sol when solidity < 0.4.0
contract OraclizeI {
address public cbAddress;
function query(uint _timestamp, string _datasource, string _arg) payable returns (bytes32 _id);
function query_withGasLimit(uint _timestamp, string _datasource, string _arg, uint _gaslimit) payable returns (bytes32 _id);
function query2(uint _timestamp, string _datasource, string _arg1, string _arg2) payable returns (bytes32 _id);
function query2_withGasLimit(uint _timestamp, string _datasource, string _arg1, string _arg2, uint _gaslimit) payable returns (bytes32 _id);
function getPrice(string _datasource) returns (uint _dsprice);
function getPrice(string _datasource, uint gaslimit) returns (uint _dsprice);
@manuelbieh
manuelbieh / sequelize-schema-file-generator.js
Last active January 16, 2024 19:25
Automatically generates migration files from your sequelize models
import * as models from "models";
import Sequelize from "sequelize";
import fs from "fs";
delete models.default;
const sequelize = new Sequelize(
'',
'',
'', {