Skip to content

Instantly share code, notes, and snippets.

View rafawashere's full-sized avatar
😀
Available

Rafael Hernandez rafawashere

😀
Available
View GitHub Profile
@Anshul0305
Anshul0305 / index.js
Created January 13, 2020 10:04
Connecting Dialogflow with External APIs
'use strict';
const axios = require('axios');
const functions = require('firebase-functions');
const {WebhookClient} = require('dialogflow-fulfillment');
const {Card, Suggestion} = require('dialogflow-fulfillment');
process.env.DEBUG = 'dialogflow:debug'; // enables lib debugging statements
exports.dialogflowFirebaseFulfillment = functions.https.onRequest((request, response) => {
@nyze2oo9
nyze2oo9 / index.d.ts
Last active February 15, 2021 03:43
Basic Cloudinary React Prop Types
declare module 'cloudinary-react' {
type CropMode =
| string
| 'scale'
| 'fit'
| 'limit'
| 'mfit'
| 'fill'
| 'lfill'
| 'pad'
@Anshul0305
Anshul0305 / Send_Email_From_Dialogflow.js
Last active February 17, 2023 14:51
How to send emails from Dialogflow
const nodemailer = require("nodemailer");
const transporter = nodemailer.createTransport({
service: 'gmail',
auth: {
user: 'YOUR_GMAIL_ID',
pass: 'YOUR_GMAIL_PASSWORD'
}
});
@Anshul0305
Anshul0305 / Buttons
Last active October 30, 2021 20:08
BotUI Custom Payload
{
"buttons": [
"BUTTON 1",
"BUTTON 2"
]
}
@timc1
timc1 / use-auth.js
Created June 10, 2019 00:20
React Context + Hooks + Firebase Authentication
import React from 'react'
import firebaseConfig from '../path/to/firebase-config'
import firebase from 'firebase/app'
import 'firebase/auth'
import FullPageLoading from '../path/to/full-page-loading'
AuthProvider.actions = {
setUser: 'SET_USER',
toggleLoading: 'TOGGLE_LOADING',
}
@Anshul0305
Anshul0305 / Buttons_Template.js
Last active January 14, 2022 19:21
Facebook Code Snippets
{
"facebook":{
"attachment":{
"type":"template",
"payload":{
"template_type":"button",
"text":"What do you want to do next?",
"buttons":[
{
"type":"web_url",
@mojaray2k
mojaray2k / instafeedjsaccess.md
Last active May 22, 2022 10:40
Getting Instagram Access Token for http://intafeedjs.com

#Use this URL to get your client authorized for Instafeed.JS plugin for Instagram.

  1. First login into your Instargam account
  2. Then go to https://www.instagram.com/developer/
  3. At the top click on the Button that says "Manage Clients".
  4. If you have not Register a new client.
  5. Fill out everything and where it says redirect url put this url: http://instafeedjs.com
  6. Then on the security tab make sure you uncheck "Disable implicit OAuth"
  7. Finally use this link to authoruize Instafeed. Where it says "[Client ID]" replace that including the brackets with your clientID from instagram:
  8. https://instagram.com/oauth/authorize/?client_id=[Client ID]&redirect_uri=http://instafeedjs.com&response_type=token
@anthonysousa
anthonysousa / rename-multiple-files.md
Last active June 5, 2024 14:47
Rename multiple files on Mac Terminal to lowercase and replace the spaces

First, make sure you are on the right directory on mac terminal app.

If you want to change only jpg files you can use $ for f in *.JPG; instead of $ for f in *;

Renaming to lowercase

$ for f in *; do mv "$f" "`echo $f | tr "[:upper:]" "[:lower:]"`"; done

Replacing spaces in file names to hyphens

@suntong
suntong / GetFoldersByName.js
Last active July 21, 2018 01:22
Get folder ID by its name
// Get the *first* folder ID by its name
function getFolderByName(folderName) {
var folders = DriveApp.getFoldersByName(folderName);
var folderID = null;
if (folders.hasNext())
folderID = folders.next();
return folderID;
}
@hofmannsven
hofmannsven / README.md
Last active August 30, 2024 10:34
Git CLI Cheatsheet