Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env python
import pytz
import argparse
import os
import shutil
import logging
import logging.config
from datetime import datetime
from parse import parse
from import storage
View gulpfile.2.babel.js
'use strict';
const gulp = require('gulp');
const sass = require('gulp-sass');
const purgecss = require('gulp-purgecss');
const rename = require('gulp-rename');
const merge = require('merge-stream');
const plumber = require('gulp-plumber');
const autoprefixer = require('gulp-autoprefixer');
const sourcemaps = require('gulp-sourcemaps');
View gulpfile.1.babel.js
// with browsersync
'use strict';
const gulp = require('gulp');
const browserSync = require('browser-sync').create();
const sass = require('gulp-sass');
const merge = require('merge-stream');
const plumber = require('gulp-plumber');
const autoprefixer = require('gulp-autoprefixer');
View App.js
import React, { useEffect } from "react";
import { HashRouter, Route, Switch, Redirect } from "react-router-dom";
// components
import Layout from "./Layout";
// pages
import Error from "../pages/error";
import Login from "../pages/login";
import Started from "../pages/start";
View first-login.js
function UserProvider({ children }) {
Hub.listen('auth', (data) => {
const { payload } = data;
console.log('A new auth event has happened: ', data)
if (payload.event === 'signIn') {
setImmediate(() => dispatch({ type: "SET_USER", user: payload }));
// Make an API call here to check if user has logged in
jarkin13 /
Created Sep 24, 2019
Tools Form Embed Instructions

BSD Tools Form Embed

Form Types

There are two available options that you can use.

  1. inline-index.html — The styling and javascript are built within the index.html template. When using this template, all you have to do is customize the html file(more information below), then copy and paste the code wherever you want this form to live.
  2. index.html - In the case you want the html, css & javascript all separate files, you will need main.css, main.js & index.html. This is a bit more advance and you will need someone familiar with your tools setup. You will need to customize these files appropriately(more information on this below) and upload main.css & main.js to where your form lives. You will then need to copy index.html code to your form's template. Someone will need to be responsible for uploading the files to your server, as well as updating the <script> & <link> url's in the index.html file.
View webpack.config.js
const { CleanWebpackPlugin } = require('clean-webpack-plugin')
const path = require('path')
const merge = require('webpack-merge')
const server = require('./webpack/tasks/server')
const styles = require('./webpack/tasks/styles')
const assets = require('./webpack/tasks/assets')
const CONFIG = require('./webpack/config')
const taskOptions = CONFIG.getConfigKeys()
const common = merge([
jarkin13 / assets.js
Last active Jun 10, 2019
Webpack assets
View assets.js
const CompressionPlugin = require('compression-webpack-plugin');
const CopyWebpackPlugin = require('copy-webpack-plugin')
const ImageminPlugin = require('imagemin-webpack-plugin').default
exports.fonts = ({ include, exclude } = {}) => ({
module: {
rules: [
test: /\.(ttf|eot|woff|woff2)$/,