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
const bindEvent = (eventNames, selector, handler) => { | |
eventNames.split(' ').forEach((eventName) => { | |
document.addEventListener(eventName, function (event) { | |
if (event.target.matches(selector + ', ' + selector + ' *')) { | |
handler.apply(event.target.closest(selector), arguments) | |
} | |
}, false) | |
}) | |
} |
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
const grpc = require('grpc') | |
const fs = require('fs') | |
const avro = require('avsc') | |
const hexdump = require('hexdump-nodejs') | |
const encodeMessage = (avroType, request) => { | |
let opts = { | |
codec: null, | |
writeHeader: true | |
} |
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
const FIRST_FRAME_PCI_BYTE = 0x01 | |
const CONSECUTIVE_FRAME_PCI_BYTE = 0x02 | |
const FIRST_FRAME_DATA_LENGTH = 5 | |
const CONSECUTIVE_FRAME_DATA_LENGTH = 7 | |
const PADDING_BYTE = 0xAA | |
const buildFirstFrame = (responseSid, data) => { | |
const responseLength = data.length + 1 // add a byte for response SID | |
const firstFrameData = data.slice(0, FIRST_FRAME_DATA_LENGTH) | |
const firstFrameHeader = Buffer.from([ |
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
const rp = require('request-promise-native') | |
const apiRequest = (uri, form) => { | |
return rp.post({ | |
uri, | |
form, | |
json: true, | |
headers: { | |
authorization: `Basic ${Buffer.from(`${process.env.STRIPE_API_KEY}:`).toString('base64')}` | |
} |
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
See comment/image/screenshot. |
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
<!doctype html> | |
<html> | |
<head> | |
<script src="https://unpkg.com/@webcomponents/[email protected]/custom-elements-es5-adapter.js"></script> | |
<script src="https://unpkg.com/@webcomponents/[email protected]/webcomponents-bundle.js"></script> | |
<script type="module"> | |
import { LitElement, css, html } from 'https://unpkg.com/[email protected]/lit-element.js?module' | |
class SimpleGreeting extends LitElement { | |
static get styles() { |
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
<!doctype html> | |
<html> | |
<head> | |
<script type="module"> | |
import { LitElement, css, html } from 'https://unpkg.com/lit-element@latest/lit-element.js?module' | |
class RouterLink extends LitElement { | |
static get properties() { | |
return { | |
href: { type: String } |
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
drivers/usb/serial/pl2303.c:993 [pl2303]pl2303_process_read_urb =_ "%s - tty_flag = %d\012" | |
drivers/usb/serial/pl2303.c:943 [pl2303]pl2303_read_int_callback =_ "%s - nonzero urb status received: %d\012" | |
drivers/usb/serial/pl2303.c:939 [pl2303]pl2303_read_int_callback =_ "%s - urb shutting down with status: %d\012" | |
drivers/usb/serial/pl2303.c:855 [pl2303]pl2303_set_break =_ "%s - turning break %s\012" | |
drivers/usb/serial/pl2303.c:803 [pl2303]pl2303_tiocmget =_ "%s - result = %x\012" | |
drivers/usb/serial/pl2303.c:644 [pl2303]pl2303_set_termios =_ "parity = none\012" | |
drivers/usb/serial/pl2303.c:639 [pl2303]pl2303_set_termios =_ "parity = even\012" | |
drivers/usb/serial/pl2303.c:636 [pl2303]pl2303_set_termios =_ "parity = space\012" | |
drivers/usb/serial/pl2303.c:631 [pl2303]pl2303_set_termios =_ "parity = odd\012" | |
drivers/usb/serial/pl2303.c:628 [pl2303]pl2303_set_termios =_ "parity = mark\012" |
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
No. Time Source Destination Protocol Length Text item Info usb.bmRequestType usb.bRequest usb.wValue usb.wIndex usb.wLength usb.data_fragment usb.capdata | |
47 10.860227 host 2.1.0 USB 36 ✓ URB_CONTROL in 0xc0 1 0x8484 0 (0x0000) 1 | |
49 10.860227 host 2.1.0 USB 36 ✓ URB_CONTROL out 0x40 1 0x0404 207 (0x00cf) 0 | |
51 10.875827 host 2.1.0 USB 36 ✓ URB_CONTROL in 0xc0 1 0x8484 0 (0x0000) 1 | |
53 10.875827 host 2.1.0 USB 36 ✓ URB_CONTROL in 0xc0 1 0x8383 0 (0x0000) 1 | |
55 10.891427 host 2.1.0 USB 36 ✓ URB_CONTROL in 0xc0 1 0x8484 0 (0x0000) 1 | |
57 10.891427 host 2.1.0 USB 36 ✓ URB_CONTROL out 0x40 1 0x0404 222 (0x00de) 0 | |
59 10.907027 host 2.1.0 USB 36 ✓ URB_CONTROL in 0xc0 1 0x8484 0 (0x0000) 1 | |
61 10.907027 host 2.1.0 USB 36 ✓ URB_CONTROL in 0xc0 1 0x8383 0 (0x0000) 1 | |
69 10.908027 host 2.1.0 USB 36 ✓ URB_CONTROL in 0xc0 1 0x008c 0 (0x0000) 2 |
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
const usb = require('usb') | |
const util = require('util') | |
const assert = require('assert') | |
const USB_DIR_OUT = 0 | |
const USB_TYPE_VENDOR = (0x02 << 5) | |
const USB_RECIP_DEVICE = 0x00 | |
const _PACKET_ESC = 0xA5 | |
const _PACKET_HEAD = 0xAA |