Skip to content

Instantly share code, notes, and snippets.

@timpetri
timpetri / index.js
Created January 27, 2021 15:44
Javascript working around to avoid POST/Redirect/GET pattern
const express = require('express')
const app = express()
app.use(express.urlencoded({
extended: true
}))
const port = 3000
app.get('/', (req, res) => {
const page = `
<html>

Keybase proof

I hereby claim:

  • I am timpetri on github.
  • I am timpetri (https://keybase.io/timpetri) on keybase.
  • I have a public key whose fingerprint is AFA7 F026 6C41 A453 BC56 C515 634E 761E 476B 861C

To claim this, I am signing this object:

@timpetri
timpetri / gdax.js
Created December 17, 2017 21:31
Use CryptoJS for CB-ACCESS-SIGN GDAX API header
// This code does the equivalent of the node code provided in the GDAX API docs
var secret = 'PYPd1Hv4J6/7x...';
var timestamp = Date.now() / 1000;
var requestPath = '/orders';
var body = JSON.stringify(""); // body goes here
// create the prehash string by concatenating required parts
var message = timestamp + method + requestPath + body;