Skip to content

Instantly share code, notes, and snippets.

var yandexUrl = "https://translate.yandex.net/api/v1.5/tr.json/translate";
var yandexKey = "trnsl.1.1.20160825T224654Z.60d8da3a9f67c52b.ba2dfcc5fcd88c42ed64e266a52c105911fce47c";
function getMessageActions(bubble) {
return [[
"Translate",
function(bubble, peers) {
var url = yandexUrl + "?key=" + yandexKey + "&lang=en-es&text=" + encodeURI(bubble.body);
util.fetch(url).then(function(response) {
var json = JSON.parse(response.body);
function getMessageActions(bubble) {
return [[
"Like",
function(bubble, peers) { peers.send("like", "1") },
function(bubble, peers) { peers.send("like", "-1") },
]]
}
var actionHandlers = {
'like': function(bubble, value) {
import Foundation
@objc protocol FooProtocol {
var bar: Set<String> { get set }
}
class Foo : FooProtocol {
var bar = Set<String>()
}
@objc protocol FooProtocol {
var bar: Set<String> { get set }
}
class Foo : FooProtocol {
var bar = Set<String>()
}
let a = Foo()
func toggle(foo: FooProtocol, item: String) {
syntax = "proto3";
option go_package = "pb";
// Abbreviated information about a user, useful for displaying their name
// or avatar.
message User {
string ident = 1;
string name = 2;
}
syntax = "proto3";
option go_package = "pb";
import "common.proto";
// When bots are invoked, they are done so with this structure.
// Note that the oneof (union) mapping into json is simple: only one of the
// fields is populated.
message BotInvocation {