This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct InjectedNSView<Content: View, Injected: NSView>: NSViewRepresentable { | |
let content: Content | |
let injected: () -> Injected | |
func makeNSView(context: Context) -> Injected { | |
let injected = injected() | |
let hostingView = NSHostingView(rootView: content) | |
hostingView.translatesAutoresizingMaskIntoConstraints = false | |
injected.addSubview(hostingView) | |
hostingView.topAnchor.constraint(equalTo: injected.topAnchor).isActive = true | |
hostingView.bottomAnchor.constraint(equalTo: injected.bottomAnchor).isActive = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function pwcopy { | |
< /dev/urandom \ | |
LANG= \ | |
tr -dc a-zA-Z0-9 \ | |
| head -c ${1:-16} \ | |
| pbcopy \ | |
&& pbpaste \ | |
&& echo | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: deploy | |
on: | |
push: | |
branches: [ master ] | |
tags: [ v* ] | |
jobs: | |
deploy: | |
runs-on: macos-latest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -euo pipefail | |
mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles | |
echo "$PROVISIONING_PROFILE_DATA" | base64 --decode > ~/Library/MobileDevice/Provisioning\ Profiles/profile.mobileprovision |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -euo pipefail | |
security create-keychain -p "" build.keychain | |
security list-keychains -s build.keychain | |
security default-keychain -s build.keychain | |
security unlock-keychain -p "" build.keychain | |
security set-keychain-settings | |
security import <(echo $SIGNING_CERTIFICATE_P12_DATA | base64 --decode) \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -euo pipefail | |
SCHEME="$(xcodebuild -list -json | jq -r '.project.schemes[0]')" | |
PRODUCT_NAME="$(xcodebuild -scheme "$SCHEME" -showBuildSettings | grep " PRODUCT_NAME " | sed "s/[ ]*PRODUCT_NAME = //")" | |
echo "::set-env name=PRODUCT_NAME::$PRODUCT_NAME" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
!api | |
!public | |
!vercel.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"version": 2, | |
"functions": { | |
"api/**/*.[jt]s": { "runtime": "[email protected]" } | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { listenAndServe } from "https://deno.land/[email protected]/http/server.ts"; | |
import hello from "./api/hello.ts" | |
const s = listenAndServe({ port: 8000 }, hello); | |
console.log("http://localhost:8000/"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title> | |
Hello API Example | |
</title> | |
<script lang="javascript"> | |
fetch("/api/hello") | |
.then((res) => res.text()) | |
.then((text) => { | |
document.getElementById("api-response").innerHTML = text; |
NewerOlder