Skip to content

Instantly share code, notes, and snippets.

@tuzaiz
tuzaiz / app.js
Created December 10, 2019 09:13
Sign in with Apple Server Handler
const express = require('express')
const request = require('request')
const jwt = require('jsonwebtoken')
const jose = require('jose')
const app = express()
let client_id = "AppBundleID" // Maybe from client
function generateClientSecret() {
let private_key = "-----BEGIN PRIVATE KEY-----\n......\n-----END PRIVATE KEY-----" // Should store in a safe place on server side
@tuzaiz
tuzaiz / AutoFitSizeTextView.swift
Last active July 5, 2019 06:41
Fit Content Size UITextView
import UIKit
import PlaygroundSupport
class MyViewController : UIViewController {
override func loadView() {
let view = UIView()
view.backgroundColor = .white
let textView = UITextView()
textView.backgroundColor = UIColor.lightGray
pipeline {
agent any
stages {
stage('Checkout/Build/Test') {
steps {
checkout([
$class: 'GitSCM',
branches: [[name: 'develop']],
doGenerateSubmoduleConfigurations: false,
extensions: [], submoduleCfg: [],
@tuzaiz
tuzaiz / answer1.swift
Created November 27, 2017 16:41
Exam of Oursky
func isSubset(_ a: [Character], _ b: [Character]) -> Bool {
return b.filter({ (item) -> Bool in
return a.index(of: item) != nil
}).count == b.count
}
isSubset(["A", "B", "C", "D"], ["A", "C"])
isSubset(["A","B","C","D","E"], ["A","D","Z"])
isSubset(["A","D","E"], ["A","A","D","E"])