Skip to content

Instantly share code, notes, and snippets.

View AkkeyLab's full-sized avatar

Akio Itaya AkkeyLab

View GitHub Profile
@bvlion
bvlion / .ideavimrc
Last active April 13, 2025 11:22
vimrc
" 基本キーマッピング
nnoremap <Space>r <C-r> " redo
inoremap <Space>p <C-p> " 補完
nnoremap <F9> :%s/\s\+$//ge<CR> " 行末スペース削除
" ウィンドウ移動(複数エディタ分割時)
nnoremap <C-h> <C-w>h
nnoremap <C-j> <C-w>j
nnoremap <C-k> <C-w>k
nnoremap <C-l> <C-w>l
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
// by calling [NSURLProtocol registerClass:[MyURLProtocol class]]; in -application:didFinishLoadingWithOptions:, your protocol will have priority over any of the built-in protocols.
URLProtocol.registerClass(ActivityURLProtocol.self)
//URLProtocol.unregisterClass(ActivityURLProtocol.self)
print(URLSession.shared.configuration.protocolClasses)
}
@eleev
eleev / URLForPHAsset.swift
Last active April 2, 2025 13:33
Getting URL for PHAsset (Swift 3.0)
func getURL(ofPhotoWith mPhasset: PHAsset, completionHandler : @escaping ((_ responseURL : URL?) -> Void)) {
if mPhasset.mediaType == .image {
let options: PHContentEditingInputRequestOptions = PHContentEditingInputRequestOptions()
options.canHandleAdjustmentData = {(adjustmeta: PHAdjustmentData) -> Bool in
return true
}
mPhasset.requestContentEditingInput(with: options, completionHandler: { (contentEditingInput, info) in
completionHandler(contentEditingInput!.fullSizeImageURL)
})