This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export interface ISpi { | |
write(buffer: Buffer, callback: (error: any, data: any) => void): void; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export interface ILedStrip { | |
all(r: number, g: number, b: number, a?: number): void; | |
set(led: number, r: number, g: number, b: number, a?: number): void; | |
clear(): void; | |
off(): void; | |
sync(): void; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function createToken(payload, key) { | |
var header = { typ: 'JWT', alg: 'HS256' }; | |
var segments = []; | |
segments.push(encodeURIComponent(btoa(JSON.stringify(header)))); | |
segments.push(encodeURIComponent(btoa(JSON.stringify(payload)))); | |
var footer = sign(segments.join('.'), key); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let RouteRecognizer = require("route-recognizer"); | |
let router = new RouteRecognizer(); | |
router.add([{ path: '*path', handler: null }]); | |
router.add([{ path: '/report/pages', handler: null }]); | |
router.add([{ path: '/report/pages/:pageName', handler: null }]); | |
router.add([{ path: '/report/pages/:pageName/visuals/:visualId', handler: null }]); | |
let getPages = router.recognize('/report/pages'); | |
console.log('/report/pages: ', getPages); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var graphql = require('graphql'); | |
export function Edge(itemType: any) { | |
return new graphql.GraphQLObjectType({ | |
name: "Edge", | |
description: "Generic edge to allow cursors", | |
fields: () => ({ | |
node: { type: itemType }, | |
cursor: { type: graphql.GraphQLString } | |
}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
units: { | |
type: pagination.Page(Unit), | |
description: "Return the 'first' X number of items 'after' the specified cursor'", | |
args: { | |
first: { | |
type: graphql.GraphQLInt, | |
description: "Limits the number of results returned in the page. Defaults to 10." | |
}, | |
after: { | |
type: graphql.GraphQLString, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
units(first: 2, after: "ODg=") { | |
totalCount | |
edges { | |
node { | |
id | |
meta { | |
name | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"data": { | |
"units": { | |
"totalCount": 140, | |
"edges": [ | |
{ | |
"node": { | |
"id": 288, | |
"meta": { | |
"name": "Banshee" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GET http://www.example.com/ HTTP/1.1 | |
User-Agent: Fiddler | |
Host: www.example.com | |
x-session-id: 1756a272-0f00-488f-832a-0b902170b1bf | |
x-activity-id: 717c62a2-41ac-41e4-bce2-47d65d4162cc | |
x-json-data: eyJmb28iOjEsImJhciI6MiwiYmF6IjozLCJvYmoiOnsiYSI6ImEiLCJiIjoiYiIsImMiOiJjIn19 | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static BindUIColumn("x-activity-id", 61) | |
function BindSessionId(oS: Session): String { | |
return oS.RequestHeaders["x-activity-id"]; | |
} |