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 | |
} |
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
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
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
// 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
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
{ | |
"entry": [{ | |
"id": "39067632506", | |
"time": 1489304167705, | |
"messaging": [{ | |
"sender": { | |
"id": "1713278708698563" | |
}, | |
"recipient": { | |
"id": "39067632506" |
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
//// | |
// Get started | |
// This is a webhook postback with event (an event determines which API.ai intent | |
// will fire when a button with an event payload is clicked). | |
// See example: http://i.imgur.com/jPFHuZ2.png (see events, in this case, the | |
// getstarted intent will fire because in the payload, the event is getStarted. | |
// It's like a unique identifier. | |
//// | |
{ | |
"entry": [{ |
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
// Simulate get started | |
{ | |
"entry": [{ | |
"id": "<PAGE_ID>", | |
"time": 1489304167705, | |
"messaging": [{ | |
"sender": { | |
"id": "<USER_ID>" | |
}, | |
"recipient": { |
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
find . -maxdepth 2 | # Find files | |
grep ".html" | # Grep for all html files | |
xargs -I % grep "\"solution-apis-used_list_item\"" % | # Search for a string in those files | |
wc -l # Return number of found instances |
OlderNewer