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
// Load the AWS SDK for Node.js | |
var AWS = require('aws-sdk'); | |
// Set the region | |
AWS.config.update({ | |
accessKeyId: '....', | |
secretAccessKey: '....', | |
region: 'eu-central-1' | |
}); |
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
// MARK: - Beta 2 code | |
func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { | |
// Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`. | |
// If using a storyboard, the `window` property will automatically be initialized and attached to the scene. | |
// This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead). | |
// Use a UIHostingController as window root view controller | |
let window = UIWindow(frame: UIScreen.main.bounds) | |
window.rootViewController = UIHostingController(rootView: ContentView()) | |
self.window = window |
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 UIKit | |
extension UIDevice { | |
/// Returns 'true' if the current device has a notch | |
var hasNotch: Bool { | |
if #available(iOS 11.0, *) { | |
// Case 1: Portrait && top safe area inset >= 44 | |
let case1 = !UIDevice.current.orientation.isLandscape && (UIApplication.shared.keyWindow?.safeAreaInsets.top ?? 0) >= 44 |
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
/** | |
* Copyright (c) 2017 Håvard Fossli. | |
* | |
* Licensed under the MIT license, as follows: | |
* | |
* Permission is hereby granted, free of charge, to any person obtaining a copy | |
* of this software and associated documentation files (the "Software"), to deal | |
* in the Software without restriction, including without limitation the rights | |
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
* copies of the Software, and to permit persons to whom the Software is |
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
static let keypair: EllipticCurveKeyPair.Manager = { | |
EllipticCurveKeyPair.logger = { print($0) } | |
let publicAccessControl = EllipticCurveKeyPair.AccessControl(protection: kSecAttrAccessibleAfterFirstUnlock, flags: []) // QUA: kSecAttrAccessibleAlways | |
let privateAccessControl = EllipticCurveKeyPair.AccessControl(protection: kSecAttrAccessibleAfterFirstUnlock, flags: [.privateKeyUsage]) // QUA: kSecAttrAccessibleAlways | |
let config = EllipticCurveKeyPair.Config( | |
publicLabel: "no.agens.encrypt.public", | |
privateLabel: "no.agens.encrypt.private", | |
operationPrompt: "", | |
publicKeyAccessControl: publicAccessControl, | |
privateKeyAccessControl: privateAccessControl, |
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
module.exports = { | |
config: { | |
// default font size in pixels for all tabs | |
fontSize: 13, | |
// font family with optional fallbacks | |
fontFamily: 'Menlo, "DejaVu Sans Mono", Consolas, "Lucida Console", monospace', | |
// terminal cursor background color and opacity (hex, rgb, hsl, hsv, hwb or cmyk) | |
cursorColor: 'rgba(248,28,229,0.8)', |
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
var destFolder = null; | |
destFolder = Folder.selectDialog( 'Select the folder where you want to save the exported files.', app.activeDocument.path ); | |
var baseDestName = app.activeDocument.name; | |
if (baseDestName.indexOf('.') < 0) | |
{ | |
//nothing | |
} else { |
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
// Kudos to: http://stackoverflow.com/questions/160890/generating-random-numbers-in-objective-c | |
#include <stdlib.h> | |
#define MAX 10 | |
int r = arc4random() % MAX; |
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
// Try this Code For Round Image Import QuartzCore framework simple way to create Round Image | |
// http://stackoverflow.com/questions/7705879/ios-create-a-uiimage-or-uiimageview-with-rounded-corners | |
UIImageView *imageView; | |
imageView.layer.backgroundColor=[[UIColor clearColor] CGColor]; | |
imageView.layer.cornerRadius=20; | |
imageView.layer.borderWidth=2.0; | |
imageView.layer.masksToBounds = YES; | |
imageView.layer.borderColor=[[UIColor redColor] CGColor]; |