Skip to content

Instantly share code, notes, and snippets.

View lrettig's full-sized avatar
🚀
Going to the moon

Lane Rettig lrettig

🚀
Going to the moon
View GitHub Profile
@kndt84
kndt84 / authorize.js
Last active May 17, 2024 03:11
Sample code: how to refresh session of Cognito User Pools with Node.js and Express
const AWS = require('aws-sdk');
const CognitoUserPool = require('amazon-cognito-identity-js-node').CognitoUserPool;
const CognitoUserSession = require('amazon-cognito-identity-js-node').CognitoUserSession;
const CognitoUser = require('amazon-cognito-identity-js-node').CognitoUser;
const CognitoIdToken = require('amazon-cognito-identity-js-node').CognitoIdToken;
const CognitoAccessToken = require('amazon-cognito-identity-js-node').CognitoAccessToken;
const CognitoRefreshToken = require('amazon-cognito-identity-js-node').CognitoRefreshToken;
const cfg = require('config').config;
const COGNITO_IDENTITY_POOL_ID = cfg.COGNITO_IDENTITY_POOL_ID;
@klaaspieter
klaaspieter / ASS.md
Created June 22, 2017 07:59 — forked from anonymous/ASS.md
Acronyms Seriously Suck - Elon Musk

From time to time, Musk will send out an e-mail to the entire company to enforce a new policy or let them know about something that's bothering him. One of the more famous e-mails arrived in May 2010 with the subject line: Acronyms Seriously Suck:

There is a creeping tendency to use made up acronyms at SpaceX. Excessive use of made up acronyms is a significant impediment to communication and keeping communication good as we grow is incredibly important. Individually, a few acronyms here and there may not seem so bad, but if a thousand people are making these up, over time the result will be a huge glossary that we have to issue to new employees. No one can actually remember all these acronyms and people don't want to seem dumb in a meeting, so they just sit there in ignorance. This is particularly tough on new employees.

That needs to stop immediately or I will take drastic action - I have given enough warning over the years. Unless an acronym is approved by me, it should not enter the SpaceX glossary.

@axic
axic / roadmap.md
Last active August 11, 2018 20:34
eWASM Roadmap 2017-2018 [Not kept up to date]
@jwasinger
jwasinger / ewasm-testnet-cpp-config.json
Last active January 22, 2018 14:51
genesis-sentinel-contract
{
"sealEngine": "Ethash",
"params": {
"accountStartNonce": "0x00",
"maximumExtraDataSize": "0x20",
"homesteadForkBlock": "0x00",
"EIP150ForkBlock": "0x00",
"EIP158ForkBlock": "0x00",
"byzantiumForkBlock": "0x00",
"minGasLimit": "0x5208",
@hugo-dc
hugo-dc / cpp-ethereum_brk.md
Last active April 27, 2018 04:33
cpp-ethereum breakpoints

1. Converts the recipient's public key to PKCS8

ssh-keygen -f id_rsa.pub -e -m PKCS8 > id_rsa.pkcs8.pubkey

One way to obtain a recipient's public key is from GitHub, by adding .keys to their profile url, e.g. https://github.com/noamnelke.keys

2. Encrypt a string

This pipes a secret string into openssl, encrypts it with the recipient's public key and pipes the result to openssl again to transcode it into base64 (without the last step it would be binary, which is fine for a file, but harder to paste somewhere).

@axic
axic / README.md
Last active December 15, 2021 03:14
ewasm “WRC20” token contract coding challenge

ewasm “WRC20” token contract coding challenge

This document describes a simple contract in pseudocode and gives a couple of test cases for it.

The challenge is designed to be fairly easy to implement in a language of choice, compiled to wasm and interacted with. It is loosely based on the ERC20 token standard, named "WRC20", where the W stands for WebAssembly.

External interface

The contract has two features:

@chpatrick
chpatrick / nix-cmake
Created September 15, 2018 11:38
Using CLion with Nix
#!/usr/bin/env python3
# let's say you have a C++ project in Nix that you want to work on with CLion so that the Nix dependencies are available
# put this script in your project directory
# then, in Settings -> Build, Execution, Deployment -> Toolchains set CMake to this script
# if you need any extra nix-shell arguments, add them to the invocation at the bottom
import os
import sys
import shlex