Skip to content

Instantly share code, notes, and snippets.

View grundyoso's full-sized avatar

Richard Grundy grundyoso

View GitHub Profile
@grundyoso
grundyoso / loyaltyCard-class.json
Created August 20, 2020 13:59
PassNinja loyalty pass template - Google
{
"kind": "walletobjects#offerClass",
"title": "{{organizationName}}",
"redemptionChannel": "both",
"provider": "PassNinja",
"titleImage": {
"kind": "walletobjects#image",
"sourceUri": {
"uri": "https://s3.amazonaws.com/www.passninja.com-artifacts/passes/demo.loyaltyCard/template/ninji.png"
}
@grundyoso
grundyoso / loyaltyCard-pass.json
Last active August 20, 2020 13:57
PassNinja loyalty pass template - Apple
{
"formatVersion": 1,
"passTypeIdentifier": "pass.com.passninja.demo.loyaltyCard",
"webServiceURL": "https://ec-api.passninja.com/",
"teamIdentifier": "Q338UYGFZ8",
"organizationName": "{{organizationName}}",
"description": "{{description}}",
"foregroundColor": "rgb(255,255,255)",
"backgroundColor": "rgb(26,17,38)",
"labelColor": "rgb(255,232,195)",
@grundyoso
grundyoso / npm run test
Created December 10, 2019 10:15
passninja-passkit
MLLA6702:passninja-passkit rgrundy$ npm run test
> passninja-passkit@1.0.0 test /Users/rgrundy/Documents/personal/workspace/passninja-passkit
> jest
PASS src/utils/W3CDateString.spec.ts (13.619s)
PASS src/utils/typeGuards.spec.ts (13.846s)
PASS src/PassStructure.spec.ts (14.239s)
PASS src/PassJson.spec.ts (14.267s)
PASS src/Field.spec.ts (14.274s)
@grundyoso
grundyoso / gist:36b429111fa094f268d779aa4f72c735
Created November 26, 2019 10:11
RPI0 scanning of bioconnect without config file in place
pi@SmartBasket:~/passninja-cli $ node out/pn.js scan --http --config /home/bioconnect/config.json
>>>
>>>
>>> No config file found at /home/bioconnect/config.json
>>>
>>> publishing scans via http POST to: http://localhost:3080
>>>
>>>
>>>
>>> SCANNER STARTED
@grundyoso
grundyoso / gist:3e63254ce952633083dcece936da9ee4
Created November 26, 2019 09:55
RPI0 scanning of bioconnect demo pass (ninja airlines)
pi@SmartBasket:~/passninja-cli $ node out/pn.js scan --http
>>>
>>>
>>> publishing scans via http POST to: http://localhost:3080
>>>
>>>
>>>
>>> SCANNER STARTED
>>>
>>> POLLING FOR
@grundyoso
grundyoso / PyroPalma.ino
Created July 29, 2019 18:27
Arduino sketch for LightBlue Bean for PyroPalma project
#define PYRORLY 5
#define PYROBTN 13
void setup() {
Serial.begin();
Serial.setTimeout(5);
pinMode(PYRORLY, OUTPUT);
digitalWrite(PYRORLY, HIGH);
}
{
"formatVersion" : 1,
"passTypeIdentifier" : "pass.com.ndudfield.nfc",
"serialNumber" : "8j23fm3",
"webServiceURL" : "https://passninja.com/passes/",
"authenticationToken" : "vxwxd7J8AlNNFPS8k0a0FfUFtq0ewzFdc",
"teamIdentifier" : "Q338UYGFZ8",
"barcode" : {
"message" : "123456789",
"format" : "PKBarcodeFormatPDF417",
pi@SmartBasket:~/pn-cli-dont-share $ grep -nsHR pass-ninja .
./pn.js:35326:eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.awsResourcesDev = { region: 'us-east-1',\n stackName: 'pass-ninja-web-dev',\n UserPool: 'us-east-1_IKX2BYIbL',\n ApiGatewayRestApi: '59ddsai502',\n DemoPassBucket: 'pass-ninja-web-dev-us-east-1-demo-passes-bucket',\n UserPoolClient: '31rageklk93ge7k82e4it9jmp4',\n IdentityPool: 'us-east-1:99a31351-e839-4cb5-87d1-6da385cb3779',\n iotOwnThingsPolicy: 'pass-ninja-web-dev-us-east-1-cognitos-own',\n iotThingsOwnPolicy: 'pass-ninja-web-dev-us-east-1-things-own' };\n\n\n//# sourceURL=webpack://commonjs/./src/config/aws-resources-dev.ts?");
./pn.js:35338:eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.awsResourcesTest = { region: 'us-east-1',\n stackName: 'pass-ninja-web-test',\n UserPool: 'us-east-1_A1YVKkzgz',\n ApiGatewayRestApi: 'v9b4qnu6c7',\n DemoPassBucket: 'pass-ninja-web-test-us-east-1
Passninja
Hi, welcome to the Passninja coding challenge. This challenge is meant to give us an understanding of your capabilities using the technologies we use to build our applications. The subject matter (bitcoin) is unrelated to what we do on a daily basis, so don't worry if you don't have a deep understanding of it (you won't need it beyond this challenge).
MAKE SURE YOU READ EVERYTHING BEFORE YOU START WRITING CODE
The Challenge
We're going to be building a Node.JS API endpoint that creates a bitcoin wallet, writing tests and deploying it on AWS lambda.
We'll also have a front end portion that uses the lambda endpoint to create a wallet that will be deployed/uploaded to S3.
curl 'https://dev-api.passninja.com/://passninja.com' -v \
-H 'accept-encoding: gzip, deflate, br' \
-H 'accept-language: en-US,en;q=0.9' \
-H 'user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36' \
-H 'content-type: application/json' \
-H 'accept: application/json, text/plain, */*' \
-H 'referer: https://passninja.com/demo/make-pass' \
-H 'authority: dev-api.passninja.com' \
--data-binary \
'{"googlePass": \