Skip to content

Instantly share code, notes, and snippets.

View zilahir's full-sized avatar
🍺

Richard Zilahi zilahir

🍺
View GitHub Profile
@zilahir
zilahir / contact.js
Last active May 22, 2018 09:35
process the form
jQuery(function($) {
$(document).ready(function() {
const ajaxurl = '/contact';
$("#chili-contact-form").submit(function(e) {
e.preventDefault();
var messageObject = {
message: $("#message").val();
//invoke the firebase cloud function
$.ajax({
url : ajaxurl,
@zilahir
zilahir / index.html
Last active May 22, 2018 09:22
form
<!DOCTYPE html>
<head>
<meta charset="utf-8">
</head>
<body>
<form>
<input id="message" type="text">
<input type="submit">submit>
</form>
@zilahir
zilahir / index.js
Last active May 22, 2018 09:40
send message to slack using firebase cloud function
const functions = require('firebase-functions');
const request = require('request');
exports.addMessageToSlack = functions.https.onRequest((req, resp) => {
return new Promise((resolve, reject) => {
const message = array['message'];
request.post(
"https://hooks.slack.com/X/Y/Z",
{ json: { text: `You have a new message: ${message}`} }
)
import React, { Component } from 'react';
import { Grid, Row, Col } from 'react-flexbox-grid';
import { Cta } from './';
import Api from './../../data';
import ApiHun from './../../dataHun';
class Faq extends Component {
componentDidMount() {
let language = this.props.lang;