Skip to content

Instantly share code, notes, and snippets.

View fredriccliver's full-sized avatar
🧭
To the north

Fredric Cliver fredriccliver

🧭
To the north
View GitHub Profile
@fredriccliver
fredriccliver / SceneDelegate.swift
Created April 15, 2020 20:18
SceneDelegate.swift of SwiftUI project
import UIKit
import SwiftUI
class SceneDelegate: UIResponder, UIWindowSceneDelegate {
var window: UIWindow?
func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
let context = (UIApplication.shared.delegate as! AppDelegate).persistentContainer.viewContext
@fredriccliver
fredriccliver / SceneDelegate.swift
Last active April 15, 2020 20:18
SceneDelegate.swift of Storyboard project
import UIKit
class SceneDelegate: UIResponder, UIWindowSceneDelegate {
var window: UIWindow?
func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
guard let _ = (scene as? UIWindowScene) else { return }
}
@fredriccliver
fredriccliver / Info.plist
Created April 15, 2020 20:31
initial info.plist of Storyboard project
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
@fredriccliver
fredriccliver / Info.plist
Created April 15, 2020 20:31
initial info.plist of SwiftUI project
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
@fredriccliver
fredriccliver / WebViewControllwe.swift
Created April 16, 2020 13:48
add custom configuration into WKWebview
//
// WebVC.swift
// test
//
// Created by 정원석 on 2020/04/16.
// Copyright © 2020 fred. All rights reserved.
//
import Foundation
import UIKit
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link
href="https://unpkg.com/tailwindcss@^1.0/dist/tailwind.min.css"
rel="stylesheet"
/>
<title>Document</title>
@fredriccliver
fredriccliver / server.js
Created June 20, 2020 09:58
http request and read practice
const express = require('express')
const port = 3000
const bodyParser = require('body-parser')
const app = express()
app.use(bodyParser.urlencoded({ extended: true }))
app.get('/', (req, res) => {
res.send("hello")
})
app.post('/', (req, res) => {
@fredriccliver
fredriccliver / caller.js
Created June 20, 2020 09:58
http request and read practice
const http = require('http')
const theRequest = http.request({
host: 'localhost',
path: '/',
port: 3000,
method: 'POST',
headers: {
'message': "this is a message included in the header"
},
require('dotenv').config();
const _ = require('lodash');
const fs = require('fs');
const textToSpeech = require('@google-cloud/text-to-speech');
const client = new textToSpeech.TextToSpeechClient();
const request = {
// The text to synthesize
input: {
text: 'This is an example'
{
"plugins": [
["@babel/plugin-transform-runtime",
{
"regenerator": true
}
]
]
}