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:
@gerhardberger
gerhardberger / zipWith
Created March 31, 2012 22:08
zipWith function for JavaScript.
zipWith = function() {
var args = Array.prototype.slice.call(arguments)
, ls = _.initial(args)
, ls_
, f = _.last(args)
ls_ = _.zip.apply(this, ls)
ls_ = _.map(ls_, function(x) {
return f.apply(this, x)
})
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)