Skip to content

Instantly share code, notes, and snippets.

View DougAnderson444's full-sized avatar
🕸️
Open Web, all the way

Doug A DougAnderson444

🕸️
Open Web, all the way
View GitHub Profile
@AnalyzePlatypus
AnalyzePlatypus / lambda-gmail-compose.md
Created May 13, 2020 08:11
Use serverless function to send low-volume emails without 3rd party mail services.

Sending email with serverless functions

You can deploy this function on any of the serverless platforms - AWS Lambda, Google Cloud Functions, Azure Functions, Netlify, Cloudflare Workers, etc.

  1. Create a new function and paste in the following code.
  2. You will need to add nodemailer to your package.json (npm i nodemailer), and follow your platform's instructions on bundling dependencies.
  3. Obtain Gmail API credentials for your account. You will need clientID, clientSecret, and refreshToken. Follow this YouTube tutorial
  4. Expose these credentials as the follwing environment variables:
GMAIL_EMAIL_ADDRESS
@andelf
andelf / main.rs
Created May 14, 2020 10:31
Embed Deno in Rust
use deno_core::Op;
use deno_core::ZeroCopyBuf;
use deno_core::{CoreIsolate, StartupData};
use std::str;
fn main() {
println!("v8 version: {}", deno_core::v8_version());
let mut isolate = CoreIsolate::new(StartupData::None, false);
@peterVG
peterVG / ipfs-on-raspberry-pi.md
Last active April 28, 2024 22:34
Put IPFS decentralized storage on your Raspberry Pi with USB storage

I put IPFS on a Raspberry Pi and so should you!

Total cost of joining the decentralized storage revolution with your own lo-fi node: $124 USD

raspberry-ipfs

@TheLoneRonin
TheLoneRonin / ARWEAVE.GQL.MD
Last active December 11, 2023 13:18
Arweave Query Guide

Arweave GraphQL Guide

Retrieving Data

In order to retrieve data from Arweave, you can use the following example query to retrieve the entire transaction output.

query {
    transactions {
        cursor
@tplooker
tplooker / did-github-proof.jsonld
Created November 21, 2020 10:02
DID to Github Account Linkage Proof
{
"@context": [
"https://www.w3.org/2018/credentials/v1",
{
"sameAs": "https://www.w3.org/TR/owl-ref/#sameAs-def"
}
],
"issuer": "did:key:z6MkkWRMquVJsLaqsD45TYzhhDRJWJGDBx8jUkFGt6zvLc3R",
"issuanceDate": "2020-11-21T10:02:39.501Z",
"type": [
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@lvngd
lvngd / rectCollide.js
Created February 3, 2021 19:20
Rectangular collision detection in D3 force layouts. Blog post: https://lvngd.com/blog/rectangular-collision-detection-d3-force-layouts
function rectCollide() {
var nodes,sizes,masses;
var strength = 1;
var iterations = 1;
var nodeCenterX;
var nodeMass;
var nodeCenterY;
function force() {
--- a/src/script/interpreter.cpp
+++ b/src/script/interpreter.cpp
@@ -504,6 +504,14 @@ bool EvalScript(std::vector<std::vector<unsigned char> >& stack, const CScript&
return set_error(serror, SCRIPT_ERR_MINIMALDATA);
}
stack.push_back(vchPushValue);
+ if ((flags & SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS) && opcode == OP_FALSE) {
+ auto pc_tmp = pc;
+ opcodetype next_opcode;
+ valtype dummy_data;