Skip to content

Instantly share code, notes, and snippets.

@ryu1
ryu1 / Android-Tips.md
Last active May 8, 2019 08:19
Android Tips

Android Tips

ADBの起動/停止

adbの停止

$ adb kill-server
@ryu1
ryu1 / cpWithLock.sh
Created January 15, 2019 09:26
指定したファイルに連番を振りコピーします。また、同時にlockもします。
#!/bin/sh
for num in $(seq -w 6000)
do
new=DSC9$num.JPG
cp DSC09525.JPG $new
chflags uchg $new
done
@ryu1
ryu1 / btos.sh
Created December 7, 2018 02:26
このスクリプトは、Back SlashをSlashに置き換えます。用途として、主に、WindowsのパスをMacのパスに変換するために使用します。
#!/bin/bash
echo -E "${1}" | tr '\' '/'
import Foundation
import PlaygroundSupport
/// A thread-safe array.
public class SynchronizedArray<Element> {
fileprivate let queue = DispatchQueue(label: "io.zamzam.ZamzamKit.SynchronizedArray", attributes: .concurrent)
fileprivate var array = [Element]()
}
// MARK: - Properties
#import <Foundation/Foundation.h>
@interface DateFormatterProvider : NSObject
+ (NSDateFormatter *)ISO8601DateFormatter;
+ (NSDateFormatter *)utcDateFormatter;
+ (NSDateFormatter *)exifDateFormatter;
+ (NSDateFormatter *)dateCalendarDateFormatter;
+ (NSDateFormatter *)monthCalendarDateFormatter;
import Foundation
// --------------------------------------------------
// Pool.swift
// --------------------------------------------------
open class Pool<T> {
// MARK: Initialization
/**
- parameter maxElementCount: Specifies the maximum number of element that the pool can manage.
import Foundation
import UIKit
// --------------------------------------------------
// UIStoryboard+.swift
// --------------------------------------------------
protocol StoryboardIdentifiable {
// Stroryboardに定義されたStoryboard ID(= ViewControllerクラス名)
static var storyboardIdentifier: String { get }
@ryu1
ryu1 / PHPhotoLibrary+SaveImage
Created April 10, 2018 07:29 — forked from khorbushko/PHPhotoLibrary+SaveImage
PHPhotoLibrary+SaveImage - save image with Photos Framework swift 3
import UIKit
import Photos
extension PHPhotoLibrary {
// MARK: - PHPhotoLibrary+SaveImage
// MARK: - Public
func savePhoto(image:UIImage, albumName:String, completion:((PHAsset?)->())? = nil) {
func save() {
+ (void)runCriticalSection:(void (^)(void))func
{
static dispatch_semaphore_t sema; // The semaphore
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
// Initialize with count=1 (this is executed only once):
sema = dispatch_semaphore_create(1);
});
// Try to decrement the semaphore. This succeeds if the count is still 1
【最初に】
Redmineは、使いこなせれば有用なプロジェクト管理ツールですが
全員がきっちり入力を行ってこそ力が発揮されます。ご協力よろしくお願いします。
【Redmine閲覧】
・メール通知は「ウォッチもしくは関係している事柄」以上のレベルで常時確認すること
・できれば「参加しているプロジェクトの全ての通知」を選択推奨
【チケット登録】
・依頼は、「すぐにチケット化する」こと