This file contains hidden or 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 Accelerate | |
import CoreGraphics | |
import CoreMedia | |
import Foundation | |
import QuartzCore | |
import UIKit | |
func createImage(from sampleBuffer: CMSampleBuffer) -> UIImage? { | |
guard let imageBuffer = CMSampleBufferGetImageBuffer(sampleBuffer) else { | |
return nil |
This file contains hidden or 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 CoreImage | |
import CoreVideo | |
import ImageIO | |
import Metal | |
/// Processes ARKits' ARFrame->capturedImage CVPixelBuffer according to the documentation into an sRGB image. | |
/// | |
/// ARKit captures pixel buffers in a full-range planar YCbCr format (also known as YUV) format according to the ITU R. 601-4 standard. | |
/// (You can verify this by checking the kCVImageBufferYCbCrMatrixKey pixel buffer attachment.) | |
/// Unlike some uses of that standard, ARKit captures full-range color space values, not video-range values. |
This file contains hidden or 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 {renderToStaticMarkup, renderToString} from "react-dom/server"; | |
import {App} from "./App"; | |
import {ServerStyleSheet} from "styled-components"; | |
export default async (props = {}) => { | |
const sheet = new ServerStyleSheet(); | |
const div = renderToString(sheet.collectStyles(<App {...props} />)); | |
// there is no point to dynamicially change the head at runtime | |
// when users share a link, crawler will hit that link again |
This file contains hidden or 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 | |
docker pull certbot/dns-cloudflare | |
mkdir -p /etc/letsencrypt | |
cd /etc/letsencrypt | |
touch dns-cloudflare.ini | |
chmod 600 dns-cloudflare.ini | |
echo -n "dns_cloudflare_email: " | |
read EMAIL |