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
Thought I'd lost this, but found the link in http://del.icio.us/ of all places: http://toroid.org/git-website-howto. | |
Saving these here in case it disappears. | |
Second article, new to me: http://crosbymichael.com/how-to-manage-your-website-with-git.html | |
---------- | |
Using Git to manage a web site | |
By Abhijit Menon-Sen <[email protected]> | |
2008-12-17 | |
The HTML source for my (i.e., this) web site lives in a Git repository on my local workstation. This page describes how I set things up so that I can make changes live by running just "git push web". |
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
Once upon a time there was a junior developer who had a simple ticket | |
assigned to him to make a new checkbox. The straightforward implementation | |
required a schema change to implement. Being a fastidious fellow, he wanted to | |
follow the proper procedure and searched the wiki. | |
The wiki described a procedure that required he run a particular script against | |
the qa database server and add the output to his ticket. He looked over the | |
script and found that it would not run on his OSX box. | |
After editing the script so that it would run on his laptop, he submitted the |
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
/* | |
Example Facebook Messenger app that pulls the user's public profile and echoes back any messages sent | |
with the user's first and last name. | |
So if I sent the bot "Good morning!" it will reply to me with "Echoing message from Jeff Israel: Good morning!" | |
*/ | |
const bodyParser = require('body-parser'); | |
const crypto = require('crypto'); | |
const express = require('express'); |
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
/* | |
Example Facebook Messenger app that pulls the user's public profile and echoes back any messages sent | |
with the user's first and last name. This one uses BotKit. | |
So if I sent the bot "Good morning!" it will reply to me with "Echoing message from Jeff Israel: Good morning!" | |
*/ | |
const reqPromise = require('request-promise'); | |
const graphApiUrl = 'https://graph.facebook.com/v2.6'; |
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
messenger.on(‘message.image’, ({senderId, url, session}) => { | |
// cool bot stuff | |
… | |
// reply to the user! | |
messenger.send(userId, { text: ‘something a robot would say’ } ); | |
}); |
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
routeEachMessage(messagingEvent) { | |
const cacheKey = messagingEvent.sender.id; | |
return cache.get(cacheKey) | |
.then((session = {_key: cacheKey, count: 0}) => { | |
// check if profile info is already in the session, | |
// if not, fetch it from Graph API | |
}) | |
.then((session) => { | |
session.count++; | |
if (messagingEvent.message) { |
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
// Object | |
function Image(url) { | |
this.attachment = { | |
type: ‘image’, | |
payload: { url } | |
}; | |
} | |
// Application Usage | |
messenger.send(senderId, new Image(imageUrl))); |
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
// Object | |
function Generic(elements) { | |
this.attachment = { | |
type: ‘template’, | |
payload: { | |
template_type: ‘generic’, | |
elements: elements | |
} | |
}; | |
} |
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
const { Messenger } = require('launch-vehicle-fbm'); | |
const messenger = new Messenger(); | |
messenger.start(); |
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
const { Messenger, responses } = require('launch-vehicle-fbm'); | |
const messenger = new Messenger(); | |
messenger.start(); | |
// EVENT HANDLERS | |
///////////////// | |
messenger.on('text.greeting', ({senderId, session, firstName, surName, fullName}) => { | |
const greeting = new responses.Text(`🤖 beep bop boop. Hello ${fullName}, I am a bot.`); |
OlderNewer