View gist:7409269
.../* 勝手に狭まる要素に対して */ { | |
background: url(data:image/gif;base64,R0lGODlhAQABAPAAAP///wAAACH/C1hNUCBEYXRhWE1QAz94cAAh+QQFAAAAACwAAAAAAQABAEACAkQBADs=); | |
} |
View testApp.h
#import <CoreMotion/CoreMotion.h> | |
class testApp : public ofxiOSApp { | |
CMMotionManager *motionManager; | |
public: | |
void setup(); | |
void update(); | |
void draw(); | |
void exit(); |
View gist:6cd5b915b759e60de389
/* とにかくモーダルを全部閉じる */ | |
// どこからでもOK | |
[[UIApplication sharedApplication].keyWindow.rootViewController dismissViewControllerAnimated:YES completion:nil]; | |
// もしくはこちら | |
[[UIApplication sharedApplication].delegate.window.rootViewController dismissViewControllerAnimated:YES completion:nil]; | |
/* ある階層までのモーダルを閉じる */ |
View main.coffee
WebSocketServer = require("websocket").server | |
WebSocketClient = require("websocket").client | |
Http = require("http") | |
class ServerManager | |
constructor: -> | |
@server = {} | |
@webSocketServer = {} | |
startServer: -> |
View gist:936e5fac1e00e49fdd85
// どこかで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
#!/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
sudo xcrun xcscontrol --reset |
View gist:1f74224d7c62f01654ec
#!/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
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
struct Person { | |
let name: String | |
func isValid() -> Bool { | |
return !name.characters.isEmpty | |
} | |
} | |
let validPerson = Person(name: "Tom") | |
let invalidPerson = Person(name: "") |
OlderNewer