Skip to content

Instantly share code, notes, and snippets.

View slvnperron's full-sized avatar

Sylvain Perron slvnperron

View GitHub Profile
@slvnperron
slvnperron / RetryTest1.cs
Last active August 29, 2015 13:57
NUnit-Retry Not Retried
[TestFixture]
public class RetryTest
{
private static int _count = 0;
[Test]
public void WontBeRetried()
{
if (_count++ >= 1)
{
@slvnperron
slvnperron / testHook.js
Created July 27, 2015 22:11
My first hook.io microservice
// A simple hello world microservice
// Click "Deploy Service" to deploy this code
// Service will respond to HTTP requests with a string
module['exports'] = function helloWorld (hook) {
// hook.req is a Node.js http.IncomingMessage
var host = hook.req.host;
// hook.res is a Node.js httpServer.ServerResponse
// Respond to the request with a simple string
hook.res.end(host + ' says, "Hello world!"');
};
@slvnperron
slvnperron / testHook.js
Created July 29, 2015 02:52
My first hook.io microservice
// A simple hello world microservice
// Click "Deploy Service" to deploy this code
// Service will respond to HTTP requests with a string
module['exports'] = function helloWorld (hook) {
// hook.req is a Node.js http.IncomingMessage
var host = hook.req.host;
// hook.res is a Node.js httpServer.ServerResponse
// Respond to the request with a simple string
hook.res.end(host + ' says, "Hello world !! ! !!! ! !!! !"');
@slvnperron
slvnperron / testHook.js
Created September 15, 2015 03:09
My first hook.io microservice
// A simple hello world microservice
// Click "Deploy Service" to deploy this code
// Service will respond to HTTP requests with a string
module['exports'] = function helloWorld (hook) {
// hook.req is a Node.js http.IncomingMessage
var host = hook.req.host;
// hook.res is a Node.js httpServer.ServerResponse
// Respond to the request with a simple string
hook.res.end(host + ' says, "Hello world!"');
};
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['b'], factory);
} else {
// Browser globals
root.amdWeb = factory(root.b);
}
}(this, function (b) {
//use b in some fashion.
/*!
* Pikaday
*
* Copyright © 2014 David Bushell | BSD & MIT license | https://github.com/dbushell/Pikaday
*/
(function (root, factory)
{
'use strict';

Contribution License Agreement

This Contribution License Agreement (this " Agreement") is a binding agreement between Botpress FZE, an UAE Free Zone Establishment (" Company") and the person or entity identified below as the contributor (" You"). This Agreement conveys certain license rights to Company for Your contributions to Company's open source software projects.

BY CHECKING THE "ACCEPT" BOX BELOW YOU (A) ACCEPT THIS AGREEMENT AND AGREE THAT YOU ARE LEGALLY BOUND BY THE TERMS, AND (B) REPRESENT AND WARRANT THAT YOU ARE OF LEGAL AGE TO ENTER INTO A BINDING AGREEMENT.

  1. Definitions.
  2. a) "Project" means any of the open source software projects owned or managed by Company.
  3. b) "Submit" is the act of uploading, submitting, transmitting, or distributing code or other content to any Project, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking
@slvnperron
slvnperron / HOWTO.md
Last active March 30, 2017 21:55
Enable demo-mode for Messenger bots | Botpress Engineering Hacks 👉 https://botpress.io

Messenger Demo Mode (Chrome)

This script removes the left panel on messenger (your other conversations).

This is useful if you want to test a messenger bot distraction-free or doing a demo of your bot.

1. Install the Injector Chrome Extension

2. Configure Injector

@slvnperron
slvnperron / HOWTO.md
Last active March 3, 2017 16:26
Migrating to Botpress 0.1

Migrating to Botpress Beta 0.1

This will guide will help you to migrate your existing bots from Botpress v0.0 to v0.1.

Before you migrate

The following database tables will be lost:

  • botpress-analytics: all analytics
  • botpress-subscription: all subscriptions
  • botpress-schedulers: all schedules (past & next)
  • botpress-hitl: all messages and sessions
@slvnperron
slvnperron / THEMING.md
Created March 10, 2017 22:01
Theming your Botpress bot

Applying a custom theme to your Botpress bot

New in version 0.1 but still undocumented is the ability to override the global botpress theme.

For bots prior 0.1

You'll need to migrate your bot to 0.1 (see the README for the migration guide) then create a new file at your bot's root directory called theme.scss with this content inside.

For bots >= 0.1