Skip to content

Instantly share code, notes, and snippets.

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 <ams@toroid.org>
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".
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
/*
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');
/*
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';
@stripethree
stripethree / event-subscriber-message-image.js
Last active February 25, 2017 17:52
Event subscriber example for a user sending an image.
messenger.on(‘message.image’, ({senderId, url, session}) => {
// cool bot stuff
// reply to the user!
messenger.send(userId, { text: ‘something a robot would say’ } );
});
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) {
// Object
function Image(url) {
this.attachment = {
type: ‘image’,
payload: { url }
};
}
// Application Usage
messenger.send(senderId, new Image(imageUrl)));
// Object
function Generic(elements) {
this.attachment = {
type: ‘template’,
payload: {
template_type: ‘generic’,
elements: elements
}
};
}
const { Messenger } = require('launch-vehicle-fbm');
const messenger = new Messenger();
messenger.start();
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.`);