Skip to content

Instantly share code, notes, and snippets.

View rcaetano's full-sized avatar

Richard Caetano rcaetano

View GitHub Profile
@rcaetano
rcaetano / README.md
Last active August 24, 2023 20:51
A gallery script for photos stored in your Akord Vault.

Creating and Deploying a Vault in Akord

Akord provides a decentralized platform for users to securely store and share their digital assets. One of its features is the ability to create a Vault, which can be thought of as a secure container for your digital files. In this article, we'll walk you through the steps to set up a Vault in Akord, upload files, and publish a manifest to make your content accessible via the Permaweb.

Step 1: Setting Up Your Vault

  1. Navigate to Akord: Open your web browser and head to v2.akord.com.
  2. Create a New Public Vault: Once on the platform, initiate the process to create a new 'public' vault. This vault will be accessible to anyone on the permaweb, making it perfect for sharing content like photo galleries.

Step 2: Uploading Your Content

npm install -g neo4j-graphql graphql-cli graphql-cli-load
mkdir movies; cd movies
graphql init
neo4j-graphql movies-schema.graphql
graphql fetch-schema
grep -e "\(create\|add\)" schema.graphql
# addMovieActors(id: ID!, actors: [ID!]!): String
# createMovie(id: ID!, title: String, year: Long): String
# createActor(id: ID!, name: String): String
@saulshanabrook
saulshanabrook / README.md
Created October 19, 2016 14:20
Saving Web Crypto Keys using indexedDB

This is a working example on how to store CryptoKeys locally in your browser. We are able to save the objects, without serializing them. This means we can keep them not exportable (which might be more secure?? not sure what attack vectors this prevents).

To try out this example, first make sure you are in a browser that has support for async...await and indexedDB (latest chrome canary with chrome://flags "Enable Experimental Javascript" works). Load some page and copy and paste this code into the console. Then call encryptDataSaveKey(). This will create a private/public key pair and encrypted some random data with the private key. Then save both of them. Now reload the page, copy in the code, and run loadKeyDecryptData(). It will load the keys and encrypted data and decrypt it. You should see the same data logged both times.

@ryandotsmith
ryandotsmith / op-return.js
Created December 8, 2014 03:57
Creating op-return transactions
var util = require('util');
var bitcoin = require('bitcoinjs-lib');
var Chain = require('chain-node');
var chain = new Chain({blockChain: "testnet3"});
var b = new Buffer("Hello, world.");
var t = new bitcoin.Transaction();
t.addInput("ca7e12c753bd2a268e6f038509d72f3c44fd24064ed5ef8cde13ec987d495a64", 0);
@fanatid
fanatid / bitcoinjs-lib.js
Last active March 28, 2019 21:49
bitcoin multisig transaction demo
var bitcoin = require('bitcoinjs-lib') // 1.4.x ?
var privKeys = [
'L2ALJznyt2croGHs8duBK2TZMB3Bc5ZpFZQSmR5QQUMPDDcUWeTw', // n2t8F1D41xy6f3d2B6DtjXRRsn8dgUzQ6C
'L3gM5giJqPAJcWyD8eKv94d4QgqyzqrYeAA9DnuJe23FszsnqD1w', // mjgF67B4pyEHuGTLU5jS333EasUrZBaxMB
'KwdYxYAbxntKvrMQtDHAamPT1pyuYkDRfAwESBqCGRdz9abQo3dW', // mwzPpNMFwLoJPXw2ez8mz6RrdYGaqZDind
'L5LTWMRBt27dHde1mnvV1RzW1mxQuQBxpm2TvNHsMaNvAQKqKov2', // mt7K2ChnJSp96k93HYdC8B9oqUmqLyESpL
'L4qQgxEbKJFJKans2UxFRzXisS7o3oBkyJGirAUgTxS9CfTo9Cd4', // mmvbfVqYrXdy1i4x9UzWc4PtgN7VjMNjeY
]
@katowulf
katowulf / 1_using_queries.js
Last active April 24, 2023 07:14
Methods to search for user accounts by email address in Firebase
/***************************************************
* Simple and elegant, no code complexity
* Disadvantages: Requires warming all data into server memory (could take a long time for MBs of data or millions of records)
* (This disadvantage should go away as we add optimizations to the core product)
***************************************************/
var fb = firebase.database.ref();
/**
* @param {string} emailAddress
@gavinandresen
gavinandresen / btcpayments.rst
Last active May 28, 2024 17:41
Bitcoin Payment Messages

SEE BIP 70

See https://en.bitcoin.it/wiki/BIP_0070 for the latest version of this document; I'll keep this document so the process of discussion/revision isn't lost.

Bitcoin Payment Messages

This document proposes protocol buffer-based formats for a simple payment protocol between a customer's bitcoin client software and a merchant.

@cluePrints
cluePrints / gist:2521535
Created April 28, 2012 19:27
Installing Rails @ Amazon Linux

Steps

  • Build tools:

      sudo yum groupinstall "Development Tools"
    
  • Dependencies:

      yum install -y gcc-c++ patch readline readline-devel zlib zlib-devel \
    

libyaml-devel libffi-devel openssl-devel make bzip2 autoconf automake libtool bison iconv-devel

@rcaetano
rcaetano / iOS Project Icons
Created February 22, 2011 11:29
Creates the required iOS icons
#!/bin/bash
#
# Creates the required icon images for iOS:
# Icon.png (57x57)
# [email protected] (114x114)
# Icon-72.png (72x72)
# Icon-Small-50.png (50x50)
# Icon-Small.png (29x29)
# [email protected] (58x58)
#