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 "PhotosAlbum.h" | |
#import <Cordova/CDV.h> | |
@implementation PhotosAlbum | |
- (void)saveImageToPhotosAlbum:(CDVInvokedUrlCommand *)command { | |
[self.commandDelegate runInBackground : ^{ | |
NSString *base64String = [command.arguments objectAtIndex:0]; | |
NSData *imageData = [[NSData alloc] initWithBase64EncodedString:base64String options:0]; | |
UIImage *image = [UIImage imageWithData:imageData]; |
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 SwiftUI | |
extension View { | |
@MainActor public func screenshot(scale: CGFloat = 1.0) -> UIImage? { | |
if #available(iOS 16.0, *) { | |
// ImageRendererの方が処理速度が早く、画像が高精細 | |
let renderer = ImageRenderer(content: self) | |
renderer.scale = scale | |
renderer.isOpaque = true | |
return renderer.uiImage |
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
<style> | |
table td { | |
background: #eee; | |
} | |
table tr:nth-child(even) td { | |
background: #fff; | |
} | |
table tr:first-child td { | |
background: #0ff; | |
} |
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
# Dir class | |
if Dir.exist?(bitcode_symbol_map_path) | |
# do something | |
end | |
Dir.chdir("..") do | |
# do something | |
end |
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 | |
# Case 1 | |
# 実行結果を受け取り、失敗系のときは echo で出力する | |
set -e | |
# Anything | |
set +e | |
echo '$' "bundle install" |
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
==== bash ==== | |
# bash # | |
## Setiing PATH ## | |
$ echo ''' | |
# bash''' >> ~/.bash_profile | |
$ echo 'export BASH_SILENCE_DEPRECATION_WARNING=1' >> ~/.bash_profile |
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 UIKit | |
final class LinkTextViewDelegateRepresents: NSObject { | |
typealias Action = (_ textView: UITextView, _ url: URL, _ characterRange: NSRange, _ interaction: UITextItemInteraction) -> Bool | |
var action: Action | |
init(action: @escaping Action) { | |
self.action = action |
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 String { | |
func nsRange(from range: Range<String.Index>) -> NSRange { | |
return NSRange(range, in: self) | |
} | |
func ranges(of searchString: String, options mask: NSString.CompareOptions = [], locale: Locale? = nil) -> [Range<String.Index>] { | |
var ranges: [Range<String.Index>] = [] |
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
#! /usr/bin/env ruby | |
# encoding: UTF-8 | |
require 'uri' | |
require 'json' | |
require 'open-uri' | |
require 'openssl' | |
require 'nokogiri' | |
def get_documents_info() |