Skip to content

Instantly share code, notes, and snippets.

Sign in with Apple in ChaseApp

Apple docs

Web flow

  • Normal OAuth flow
  • Electron app should open in browser: https://appleid.apple.com/auth/authorize?redirect_uri=https://chaseapp.io/api/v1/public/apple/oauth&client_id=chase.app.service&response_mode=form_post&response_type=code&scope=openid%20email%20name&state=
  • Payload received on redirect URL:
module.exports.hello = (event, context, callback) => {
const response = {
statusCode: 200,
body: JSON.stringify({
message: 'Hello world from AWS Lambda!'
}),
}
callback(null, response)
}

veremautomata

alap osztalyok

Tape

  • add(data: bytes): hozzaad a tapehez adatot
  • isEmpty(): bool
  • take(n: int): bytes: leveszi az elso n byte-ot a szalagrol
  • peek(n: int): bytes: visszater az elso n byte-al a szalagon, de nem veszi le rola

veremautomata

alap osztalyok

Tape

  • add(data: bytes): hozzaad a tapehez adatot
  • isEmpty(): bool
  • take(n: int): bytes: leveszi az elso n byte-ot a szalagrol
  • peek(n: int): bytes: visszater az elso n byte-al a szalagon, de nem veszi le rola
function getMajorType (tape) {
if (tape[0] === UINT) return new UInt()
if (tape[0] === ARR) return new Arr()
// other major types...
}
// Solution 1.
// Here all the major types are one class and states are handled in them, but
// some things, such as handling infinite sequences are harder to achieve.
const R = require('ramda')
const ccompose = (...fs) => {
let result
return function r (...args) {
if (!R.isNil(result)) args = [result, ...args]
result = fs.shift()(...args)
if (fs.length === 0) return result
return r
const os = require('os')
const path = require('path')
const IPFS = require('ipfs')
const { createWriteStream } = require('fs')
const fileMultihash = process.argv[2]
const node = new IPFS(path.join(os.tmpDir() + '/' + new Date().toString()))
node.version((err, version) => {
const os = require('os')
const path = require('path')
const IPFS = require('ipfs')
const fileMultihash = process.argv[2]
const node = new IPFS(path.join(os.tmpDir() + '/' + new Date().toString()))
node.version((err, version) => {
if (err) return console.error(err)

castrumbene.hu

struktúra

(Ezek a menüpontok is)

const { app, BrowserWindow } = require('electron')
let win
app.on('ready', () => {
win = new BrowserWindow({
width: 800,
height: 600
})
win.loadURL('https://www.youtube.com')