View gist:7409269
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
.../* 勝手に狭まる要素に対して */ { | |
background: url(data:image/gif;base64,R0lGODlhAQABAPAAAP///wAAACH/C1hNUCBEYXRhWE1QAz94cAAh+QQFAAAAACwAAAAAAQABAEACAkQBADs=); | |
} |
View testApp.h
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(); |
View gist:6cd5b915b759e60de389
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]; | |
/* ある階層までのモーダルを閉じる */ |
View main.coffee
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: -> |
View gist:936e5fac1e00e49fdd85
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(^{ |
View gist:ce9cd0e51f3022e07aff
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 |
View gist:38c0b13068992ffe20e9
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 |
View gist:1f74224d7c62f01654ec
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' |
View gist:85743eee8609a80dd35a
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 | |
} | |
} |
View gist:649abb7aa6cea5af6d00
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: "") |
OlderNewer