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 | |
require 'xcodeproj' | |
require 'colorize' | |
Dir.chdir "#{__dir__}/../" | |
class LibraryUpdateManager | |
attr_accessor :update_carthage, :update_cocoapods, :acknowledgements_path | |
def initialize |
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
struct Person { | |
let name: String | |
func isValid() -> Bool { | |
return !name.characters.isEmpty | |
} | |
} | |
let validPerson = Person(name: "Tom") | |
let invalidPerson = Person(name: "") |
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
extension NSUUID { | |
class func timeBasedUUID() -> NSUUID { | |
let uuidSize = sizeof(uuid_t) | |
let uuidPointer = UnsafeMutablePointer<UInt8>.alloc(uuidSize) | |
uuid_generate_time(uuidPointer) | |
let uuid = NSUUID(UUIDBytes: uuidPointer) | |
uuidPointer.dealloc(uuidSize) | |
return uuid | |
} | |
} |
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 | |
require 'nokogiri' | |
require 'colorize' | |
require 'erubis' | |
class Manager | |
class SwiftConverter | |
def to_swift | |
raise 'Error: method `to_swift` is not implemented' |
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
sudo xcrun xcscontrol --reset |
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 | |
require 'xcodeproj' | |
require 'plist' | |
class UpdateVersionManager | |
def initialize | |
path = File.expand_path("#{__dir__}/../") # absolute path to your project file | |
projects = Xcodeproj::Project.open(*Dir.glob("#{path}/*.xcodeproj")) | |
@base_path = path |
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
// どこかでNotificationを受け取れるようにする | |
[[NSNotificationCenter defaultCenter] addObserver:self | |
selector:@selector(hc_sdWebImageDownloadStopNotification:) | |
name:SDWebImageDownloadStopNotification | |
object:nil]; | |
// 通知を受け取る | |
- (void)hc_sdWebImageDownloadStopNotification:(NSNotification *)notification { | |
dispatch_main_async_safe(^{ |
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
WebSocketServer = require("websocket").server | |
WebSocketClient = require("websocket").client | |
Http = require("http") | |
class ServerManager | |
constructor: -> | |
@server = {} | |
@webSocketServer = {} | |
startServer: -> |
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
/* とにかくモーダルを全部閉じる */ | |
// どこからでもOK | |
[[UIApplication sharedApplication].keyWindow.rootViewController dismissViewControllerAnimated:YES completion:nil]; | |
// もしくはこちら | |
[[UIApplication sharedApplication].delegate.window.rootViewController dismissViewControllerAnimated:YES completion:nil]; | |
/* ある階層までのモーダルを閉じる */ |
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 <CoreMotion/CoreMotion.h> | |
class testApp : public ofxiOSApp { | |
CMMotionManager *motionManager; | |
public: | |
void setup(); | |
void update(); | |
void draw(); | |
void exit(); |