This gist has moved to the faasd repo
https://github.com/openfaas/faasd/blob/master/docs/MULTIPASS.md
import Amplify from '@aws-amplify/core' | |
import config from './aws-exports' | |
Amplify.configure(config) | |
import React, { useState, useEffect } from 'react' | |
import { Text, View, TextInput, Button } from 'react-native' | |
import { DataStore } from '@aws-amplify/datastore' | |
import { Message} from './src/models' | |
const initialState = { color: 'black', title: '' } |
const canvasToBlobUrl = (() => { | |
const canvasToBlobURL = (canvas, type='image/webp', option=0.1) => { | |
const promise = new Promise(async (resolve) => { | |
await rAF(); | |
const blob = await canvasToBlob(canvas); | |
resolve(URL.createObjectURL(blob, type, option)); | |
}); | |
return promise; | |
} |
#!/bin/bash | |
cat << EOF > email.eml | |
From: "${MAIL_FROM_NAME}" <${MAIL_FROM_ADDRESS}> | |
To: "${MAIL_TO_NAME}" <${MAIL_TO_ADDRESS}> | |
Reply-To: "${MAIL_TO_NAME}" <${MAIL_TO_ADDRESS}> | |
Subject: ${MAIL_SUBJECT} | |
Content-Type: text/html; charset="utf-8" | |
Content-Transfer-Encoding: quoted-printable |
This gist has moved to the faasd repo
https://github.com/openfaas/faasd/blob/master/docs/MULTIPASS.md
const templatized = (template, vars = {}) => { | |
const handler = new Function('vars', [ | |
'const tagged = ( ' + Object.keys(vars).join(', ') + ' ) =>', | |
'`' + template + '`', | |
'return tagged(...Object.values(vars))' | |
].join('\n')) | |
return handler(vars) | |
} |
var kb = require("ble_hid_keyboard"); | |
var services = { | |
0x180a: { | |
0x2a50: { | |
value: [ | |
0x01, /* Use USB Vendor IDs */ | |
0xac, 0x05, /* Apple */ | |
0x5a, 0x02, /* Internal Keyboard */ | |
0x00, 0x00 |
# Usage: create-sshkey KEYNAME PASSPHRASE [COMMENT] | |
# KEYNAME = The file name used for the key. | |
# PASSPHRASE = The pass phrase to be used. If you wish to not use a passphrase just use a blank string (i.e. "") | |
# COMMENT = Optional Comment. If skipped the KEYNAME will be used. | |
# | |
# Example: create-sshkey my_secret.key "This is my secret passphrase" "An example key." | |
function create-sshkey() { | |
KEYNAME=$1 | |
PASSPHRASE=$2 | |
COMMENT=${3:-$KEYNAME} |
/* characteristic.js | |
* A simple custom BLE peripheral characteristic for use with Node.js and bleno. | |
* This characteristic supports read, write, and notify properties. | |
* Julian Hays - 10/14/19 | |
*/ | |
var util = require('util'); | |
var bleno = require('bleno-mac'); //or 'bleno-mac' if you are using that | |
var BlenoCharacteristic = bleno.Characteristic; |
#!/usr/bin/env python3 | |
import subprocess | |
import json | |
import os | |
from pathlib import Path | |
import requests | |
from requests.compat import urljoin |
const bleno = require("@abandonware/bleno"); | |
const CALCULATOR_SERVICE_UUID = "00010000-89BD-43C8-9231-40F6E305F96D"; | |
const ARGUMENT_1_UUID = "00010001-89BD-43C8-9231-40F6E305F96D"; | |
const ARGUMENT_2_UUID = "00010002-89BD-43C8-9231-40F6E305F96D"; | |
const RESULT_UUID = "00010010-89BD-43C8-9231-40F6E305F96D"; | |
class ArgumentCharacteristic extends bleno.Characteristic { | |
constructor(uuid, name) { | |
super({ |