Skip to content

Instantly share code, notes, and snippets.

View araphiel's full-sized avatar
🌟

Armon Raphiel araphiel

🌟
View GitHub Profile
@araphiel
araphiel / pages.data.js
Last active July 14, 2023 16:37
Page Builder Collection Example using Eleventy
const { client } = require('../helpers/contentful-client')
const groupBy = require('lodash/fp/groupBy')
async function getPageData() {
// Get all of the locales
const localeData = await client.getLocales()
const localeList = await localeData.items.map(locale => locale.code)
// Fetch collection of all page-builder pages for each locale
@araphiel
araphiel / zoomInfo.js
Last active July 30, 2021 17:19
ZoomInfo + Marketo Form - Hides form fields with ZoomInfo returned data
// ZoomInfo + Marketo Form Listener
// Created to display or hide fields that are already validated by ZoomInfo
// This script does the following:
// 1. Adds initial state to the ZoomInfo + Marketo form (to hide init values)
// 2. Prevents non-validated users from completing the form.
// @variable form expects a Marketo "form" object (standard part of Marketo form js api)
function zoomListener(form) {
if (!form) throw new Error('Marketo Form Element not supplied.')
@araphiel
araphiel / webpack.config.js
Last active May 27, 2020 15:45
Basic Webpack Setup (SASS + Babel)
const path = require('path')
const MiniCssExtractPlugin = require('mini-css-extract-plugin')
const FriendlyErrorsWebpackPlugin = require('friendly-errors-webpack-plugin')
const UglifyJsPlugin = require('uglifyjs-webpack-plugin')
const { CleanWebpackPlugin } = require('clean-webpack-plugin')
const fg = require('fast-glob')
module.exports = async (env, argv) => {
const entries = await fg([
'src/js/*.js',
@araphiel
araphiel / package.json
Last active September 8, 2019 16:19
Example Webpack Config for Static Sites
{
"name": "static-site",
"version": "2.1.0",
"description": "",
"main": "index.js",
"scripts": {
"start": "run-s webpack-prod hugo-prod",
"dev": "run-p webpack-dev hugo-dev",
"hugo-dev": "wait-on assets/dist && hugo server",
"hugo-prod": "hugo",
@araphiel
araphiel / .env
Last active January 17, 2019 19:14
Gatsby.js Docker
GATSBY_WEBPACK_PUBLICPATH=/
ENABLE_REFRESH_ENDPOINT=true
@araphiel
araphiel / index.md
Created November 2, 2018 19:45
High Res Gif
$ ffmpeg -i trim-sparkle-main.mov -filter_complex "[0:v] fps=12,scale=w=480:h=-1,split [a][b];[a] palettegen=stats_mode=single [p];[b][p] paletteuse=new=1" sparkle.gif
@araphiel
araphiel / handleChange.js
Created July 20, 2018 19:04
React form handler
handleChange = event => {
this.setState({ [event.currentTarget.name]: event.currentTarget.value })
}