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
// Taken from Apple's App Dev Training: https://developer.apple.com/tutorials/app-dev-training/ | |
/// This color is either black or white, whichever is more accessible when viewed against the scrum color. | |
var accessibleFontColor: Color { | |
var red: CGFloat = 0 | |
var green: CGFloat = 0 | |
var blue: CGFloat = 0 | |
UIColor(self).getRed(&red, green: &green, blue: &blue, alpha: nil) | |
return isLightColor(red: red, green: green, blue: blue) ? .black : .white | |
} |
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
require('dotenv/config') | |
const express = require('express') | |
const multer = require('multer') | |
const AWS = require('aws-sdk') | |
const uuid = require('uuid/v4') | |
const app = express() | |
const port = 3000 |
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
SIGN_IN_WITH_APPLE: | |
- de: Mit Apple anmelden | |
- he: התחברות באמצעות Apple | |
- en_AU: Sign in with Apple | |
- ar: تسجيل الدخول باستخدام Apple | |
- el: Σύνδεση μέσω Apple | |
- ja: Appleでサインイン | |
- en: Sign in with Apple | |
- uk: Увійти з Apple | |
- es_419: Iniciar sesión con Apple |
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
// | |
// DeviceConstants.swift | |
// SampleApp | |
// | |
// Created by RoLY roLLs on 12/31/19. | |
// Copyright © 2019 RoLYroLLs Enterprises, LLC. All rights reserved. | |
// | |
/// Taken from https://developer.apple.com/documentation/swiftui/securefield/3289399-previewdevice |
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
// | |
// ContentView.swift | |
// TryGeometryReader | |
// | |
// Created by satoutakeshi on 2019/12/07. | |
// Copyright © 2019 satoutakeshi. Licensed under MIT. | |
// | |
import SwiftUI |
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
extension UIColor { | |
// get a complementary color to this color | |
// https://gist.github.com/klein-artur/025a0fa4f167a648d9ea | |
var complementary: UIColor { | |
let ciColor = CIColor(color: self) | |
// get the current values and make the difference from white: | |
let compRed: CGFloat = 1.0 - ciColor.red |
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 Foundation | |
extension Date { | |
static func randomBetween(start: String, end: String, format: String = "yyyy-MM-dd") -> String { | |
let date1 = Date.parse(start, format: format) | |
let date2 = Date.parse(end, format: format) | |
return Date.randomBetween(start: date1, end: date2).dateString(format) | |
} |
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 Foundation | |
/** | |
Extension to save/load a JSON object by filename. (".json" extension is assumed and automatically added.) | |
*/ | |
extension JSONSerialization { | |
static func loadJSON(withFilename filename: String) throws -> Any? { | |
let fm = FileManager.default |
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
{ | |
"categories": [ | |
{ | |
"name": "Movies", | |
"videos": [ | |
{ | |
"description": "Big Buck Bunny tells the story of a giant rabbit with a heart bigger than himself. When one sunny day three rodents rudely harass him, something snaps... and the rabbit ain't no bunny anymore! In the typical cartoon tradition he prepares the nasty rodents a comical revenge.\n\nLicensed under the Creative Commons Attribution license\nhttp://www.bigbuckbunny.org", | |
"sources": [ | |
"http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" | |
], |
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 Foundation | |
import Cocoa | |
class NodeTask: NSObject { | |
private let processIdentifier = NSProcessInfo.processInfo().processIdentifier | |
private let nodeTask = NSTask() | |
private let readPipe = NSPipe() | |
private let errorPipe = NSPipe() | |
private let queue = dispatch_queue_create("NodeTask.output.queue", DISPATCH_QUEUE_SERIAL) |
NewerOlder