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
func emojiToImage(text: String, size: CGFloat) -> UIImage { | |
let outputImageSize = CGSize.init(width: size, height: size) | |
let baseSize = text.boundingRect(with: CGSize(width: 2048, height: 2048), | |
options: .usesLineFragmentOrigin, | |
attributes: [.font: UIFont.systemFont(ofSize: size / 2)], context: nil).size | |
let fontSize = outputImageSize.width / max(baseSize.width, baseSize.height) * (outputImageSize.width / 2) | |
let font = UIFont.systemFont(ofSize: fontSize) | |
let textSize = text.boundingRect(with: CGSize(width: outputImageSize.width, height: outputImageSize.height), | |
options: .usesLineFragmentOrigin, |
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
// | |
// ViewController.swift | |
// MP3RecordingSample | |
// | |
// Created by Tadashi on 2017/10/13. | |
// Copyright © 2017 UBUNIFU Inc. All rights reserved. | |
// | |
import UIKit | |
import AVFoundation | |
import AudioToolbox |
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
// | |
// ViewController.swift | |
// CoreImageDebug | |
// | |
// Created by Tadashi on 2017/10/02. | |
// Copyright © 2017 UBUNIFU Inc. All rights reserved. | |
// | |
import UIKit | |
class ViewController: UIViewController { |
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
func glkView(_ view: GLKView, drawIn rect: CGRect) { | |
if isSimulator() { | |
return | |
} | |
let start = NSDate() | |
glClearColor(0.0, 0.0, 0.0, 1.0) | |
glClear(GLbitfield(GL_COLOR_BUFFER_BIT)) |
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
// | |
// ViewController.swift | |
// PhotoCaptureSample | |
// | |
// Created by Tadashi on 2017/09/23. | |
// Copyright © 2017 UBUNIFU Incorporated. All rights reserved. | |
// | |
import UIKit | |
import AVFoundation | |
import Photos |
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
// | |
// ViewController.swift | |
// NSOperationSample | |
// | |
// Created by Tadashi on 2017/09/13. | |
// Copyright © 2017 UBUNIFU Incorporated. All rights reserved. | |
// | |
import UIKit | |
class ViewController: UIViewController { |
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
// | |
// ViewController.swift | |
// CoreImageBlendSample | |
// | |
// Created by Tadashi on 2017/07/04. | |
// Copyright © 2017 UBUNIFU Incorporated. All rights reserved. | |
// | |
import UIKit |
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
let alphaBlend = AlphaBlend() | |
alphaBlend.mix = 0.5 | |
let input1 = PictureInput(image: UIImage.init(named: "IMAGE1.jpg")!) | |
let input2 = PictureInput(image: UIImage.init(named: "IMAGE2.jpg")!) | |
let output = PictureOutput() | |
output.imageAvailableCallback = {image in | |
UIImageWriteToSavedPhotosAlbum(image, nil, nil, nil) | |
} | |
input1 --> alphaBlend |
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
UIView.setAnimationsEnabled(false) | |
button.setTitle("label", for: .normal) | |
button.layoutIfNeeded() | |
UIView.setAnimationsEnabled(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
import requests | |
import json | |
import os | |
HEADER = { | |
'Content-type': 'application/json', | |
'Authorization': 'Bearer ' + 'Channel Access Token' | |
} | |
def lambda_handler(event, context): |
NewerOlder