Skip to content

Instantly share code, notes, and snippets.

@parrots
parrots / CachingInterfaceController.h
Created April 14, 2015 02:32
CachingInterfaceController
@import WatchKit;
@interface CachingInterfaceController : WKInterfaceController
- (void)updateLabel:(WKInterfaceLabel *)label withString:(NSString *)string;
- (void)updateLabel:(WKInterfaceLabel *)label asHidden:(BOOL)hidden;
- (void)updateImage:(WKInterfaceImage *)image withImageNamed:(NSString *)imageName;
- (void)updateImage:(WKInterfaceImage *)image withBaseNameForAnimation:(NSString *)baseName withRange:(NSRange)range duration:(NSTimeInterval)duration repeatCount:(NSInteger)repeatCount;
- (NSString *)currentImageNameForImage:(WKInterfaceImage *)image;
@soranoba
soranoba / aaa_srv.erl
Last active June 19, 2016 07:34
A -> B -> C
-behaviour(gen_server).
init(_) ->
{ok, #state{member = undefined}}.
handle_call(_, _, #state{member = undefined} = State) -> {noreply, State}.
handle_cast({sync, Pids}, State) -> {noreply, #state{member = Pids}}.
@voluntas
voluntas / main.rs
Last active March 23, 2019 02:37
はじめての Rust で UDP えこーさーばー
extern crate rotor;
use std::str;
use rotor::{EventSet, PollOpt, Loop, Config, Void};
use rotor::mio::udp::UdpSocket;
use rotor::{Machine, Response, EarlyScope, Scope};
struct Context;