Skip to content

Instantly share code, notes, and snippets.

View jakehasler's full-sized avatar

Jake Hasler jakehasler

View GitHub Profile
@jakehasler
jakehasler / webchat_events.md
Created May 20, 2019 18:04
Capturing Podium Webchat Events

How to Capture Podium Webchat Events on Your Website

Learn to send Webchat events and leads to your CRM or system of record

What is this?

If you are using Podium Webchat on your business website, you have the ability to capture events from the widget and send them to the place of your choosing. This article assumes that:

  • You are currently using Podium Webchat
  • You have the technical knowledge to modify your website and write the necessary code you need to send the events
@jakehasler
jakehasler / router.js
Last active October 31, 2016 04:58
Route for accepting the POST Image Upload Request
const express = require('express');
const router = express.Router();
const Multer = require('multer');
const imgUpload = require('../modules/imgUpload');
// Handles the multipart/form-data
// Adds a .file key to the request object
// the 'storage' key saves the image temporarily for in memory
// You can also pass a file path on your server and it will save the image there
const multer = Multer({
@jakehasler
jakehasler / ImgUpload.js
Created October 31, 2016 04:40
Middleware for uploading image using the Google Cloud Storage Library
'use strict';
const storage = require('@google-cloud/storage');
const fs = require('fs')
const gcs = storage({
projectId: 'your-project-id',
keyFilename: '/path/to/keyfile.json'
});
const bucketName = 'bucket-name-for-upload'
@jakehasler
jakehasler / upload.js
Last active January 3, 2024 12:52
POST an image as `multipart/form-data`
// Function form the react-native-image-picker library
ImagePicker.showImagePicker({ title: 'Select Image' }, (response) => {
// format the image data
const image = {
uri: response.uri,
type: 'image/jpeg',
name: 'myImage' + '-' + Date.now() + '.jpg'
}
// Instantiate a FormData() object
const imgBody = new FormData();
@jakehasler
jakehasler / .vimrc
Last active October 31, 2016 03:46
Jake's .vimrc - A Work in Progress
syntax on
colorscheme onedark
syntax enable
let mapleader = ' '
set number
set tabstop=2
set shiftwidth=2
set expandtab
set nowrap
@jakehasler
jakehasler / postgres-cheatsheet.md
Created August 30, 2016 22:32 — forked from Kartones/postgres-cheatsheet.md
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

If run with -E flag, it will describe the underlaying queries of the \ commands (cool for learning!).

Most \d commands support additional param of __schema__.name__ and accept wildcards like *.*

@jakehasler
jakehasler / README-Template.md
Created June 2, 2016 22:40 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisities

@jakehasler
jakehasler / 0_reuse_code.js
Created October 27, 2015 21:17
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console