Skip to content

Instantly share code, notes, and snippets.

View yrezgui's full-sized avatar

Yacine Rezgui yrezgui

View GitHub Profile
@yrezgui
yrezgui / countries.yml
Created May 9, 2017 12:04
Hashmap of countries with name as key and iso code as value
Afghanistan: af
Albania: al
Algeria: dz
Andorra: ad
Angola: ao
Antigua and Barbuda: ag
Argentina: ar
Armenia: am
Aruba: aw
Australia: au
from slackeventsapi import SlackEventAdapter
from slackclient import SlackClient
from flask import request
import os
from watson_developer_cloud import ConversationV1
# We'll store the SlackClient instances for each team in a
# dictionary, so we can have multiple teams authed
CLIENTS = {}
from slackeventsapi import SlackEventAdapter
from slackclient import SlackClient
from flask import request
import os
from watson_developer_cloud import ConversationV1
# We'll store the SlackClient instances for each team in a
# dictionary, so we can have multiple teams authed
CLIENTS = {}
@yrezgui
yrezgui / .block
Last active March 6, 2017 07:38 — forked from mbostock/.block
Collapsible Tree
license: gpl-3.0
@yrezgui
yrezgui / chatbot.js
Created December 3, 2016 09:24
Botmaster starting script
// See documentation here: https://botmasterai.github.io/home
const Botmaster = require('botmaster');
const SlackBot = Botmaster.botTypes.SlackBot;
const SLACK_SETTINGS = {
credentials: {
clientId: process.env.SLACK_CLIENT_ID,
clientSecret: process.env.SLACK_CLIENT_SECRET,
verificationToken: process.env.SLACK_VERIFICATION_TOKEN
},
const Botmaster = require('botmaster');
const SlackBot = Botmaster.botTypes.SlackBot;
const botmaster = new Botmaster();
const slackBot = new SlackBot(SLACK_SETTINGS);
botmaster.addBot(slackBot);
botmaster.on('update', (bot, update) => {
bot.reply(update, 'Hello world');
const Botmaster = require('botmaster');
const MessengerBot = Botmaster.botTypes.MessengerBot;
const botmaster = new Botmaster();
const slackBot = new SlackBot({
credentials: {
clientId: process.env.SLACK_CLIENT_ID,
clientSecret: process.env.SLACK_CLIENT_SECRENT,
verificationToken: process.env.SLACK_VERIFICATION_TOKEN
@yrezgui
yrezgui / prepare.js
Last active August 1, 2016 12:59
Prepare answer
if(msg.payload.intents.length > 0) {
if(msg.payload.intents[0].intent === "departure_time") {
msg.payload = {"text": "The departure time of your flight is at 7:35pm"}
} else {
msg.payload = {"text": "The arrival time of your flight is at 9:35pm"}
}
} else {
msg.payload = {"text": "Sorry I did not understand"}
}
@yrezgui
yrezgui / AppDelegate.m
Created July 31, 2015 16:55
React Native tutorial 1.7
jsCodeLocation = [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
@yrezgui
yrezgui / AppDelegate.m
Last active August 29, 2015 14:26
React Native tutorial 1.6
// Open the file in Xcode and modify this line with the next one
jsCodeLocation = [NSURL URLWithString:@"http://localhost:8081/index.ios.bundle"];
// Your Mac needs to be in the same network as your device
jsCodeLocation = [NSURL URLWithString:@"http://ip-address-mac:8081/index.ios.bundle"];