This file contains hidden or 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
service.expand = function(input) { | |
let output = []; | |
let tempArray = input.slice(); | |
tempArray.forEach((data, index) => { | |
if(data.length > 0) { | |
output.push.apply(output, data); | |
} else { | |
output.push(data); | |
} |
This file contains hidden or 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
// From: | |
{ | |
"output": [{ | |
"type": "text", | |
"template": "text", | |
"text": "" | |
}, { | |
"type": "card", | |
"template": "card", | |
"title": "Card #1", |
This file contains hidden or 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
if(single_message.message && single_message.message.quick_reply) { | |
if(single_message.message.quick_reply.payload) { | |
if(single_message.message.quick_reply.payload.includes('event')) { | |
payload = JSON.parse(single_message.message.quick_reply.payload); | |
} | |
} | |
} |
This file contains hidden or 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
var linked_tree = [{ | |
id: '1-abc' | |
value: '...' | |
}, { | |
id: '2-abc', | |
parent: '1-abc', | |
value: '...' | |
}, { | |
id: '2-def', | |
parent: '1-abc', |
This file contains hidden or 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
// I have this: | |
var data = `{ | |
name: "foo" | |
}`; | |
apiWrapper.getCredentials(botId) | |
.then(function(credentials) { | |
apiWrapper.createIntent(credentials, data) | |
.then(intent => { |
This file contains hidden or 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
func someFunction() { | |
var i = "Hello world" | |
cell.likeButton.addTarget(self, action: #selector(ViewController.likePost), forControlEvents: .TouchUpInside) | |
} | |
func likePost(likeButton: UIButton) { | |
print(?) // Hello world | |
} |
NewerOlder