Skip to content

Instantly share code, notes, and snippets.

View 1forh's full-sized avatar
🎯
Focusing

Zac Minner 1forh

🎯
Focusing
View GitHub Profile
@1forh
1forh / usePDF.js
Last active November 15, 2021 21:44
React hook that generates a PDF based on an array of images and some other things
import { useEffect, useState, createContext, useContext } from 'react';
import jsPDF from 'jspdf';
import toast from 'react-hot-toast';
import toDataUrl from '../utilities/toDataUrl';
import { logEvent } from '../utilities/ga';
import useStorage from './useStorage';
import { STORAGE_KEYS } from '../config';
const CARD_WIDTH_DEFAULT = 66;
const CARD_HEIGHT_DEFAULT = 92;
@1forh
1forh / development.services.yml
Created October 4, 2019 13:24
Development services file for Drupal 8
# Local development services.
#
# To activate this feature, follow the instructions at the top of the
# 'example.settings.local.php' file, which sits next to this file.
parameters:
http.response.debug_cacheability_headers: true
twig.config:
debug: true
auto_reload: true
cache: false
@1forh
1forh / .htaccess
Created October 4, 2019 13:20
Drupal .htaccess file
#
# Apache/PHP/Drupal settings:
#
# Protect files and directories from prying eyes.
<FilesMatch "\.(engine|inc|install|make|module|profile|po|sh|.*sql|theme|twig|tpl(\.php)?|xtmpl|yml)(~|\.sw[op]|\.bak|\.orig|\.save)?$|^(\.(?!well-known).*|Entries.*|Repository|Root|Tag|Template|composer\.(json|lock))$|^#.*#$|\.php(~|\.sw[op]|\.bak|\.orig|\.save)$">
<IfModule mod_authz_core.c>
Require all denied
</IfModule>
<IfModule !mod_authz_core.c>
@1forh
1forh / settings.local.php
Last active February 26, 2020 18:58
Drupal 8 - settings.local.php
<?php
// @codingStandardsIgnoreFile
/**
* @file
* Local development override configuration feature.
*
* To activate this feature, copy and rename it such that its path plus
* filename is 'sites/default/settings.local.php'. Then, go to the bottom of
{
"production": true,
"daysBeforeToday": 3,
"apiBase": "",
"rackspace": {
"defaultMarkupFactor": 1.08
},
"freshBooks": {
"token": "",
"url": ""
@1forh
1forh / agent.json
Last active November 5, 2018 21:48
New fields for open house data
{
"company_information": {},
"custom_logo": null,
"email": "namratab@rmdfw.com",
"name": "NAMRATA BHATT",
"open_houses": [
{
"address": "4635 Copper Ridge Drive",
"bathrooms": "3",
"bathrooms_full": "0",
@1forh
1forh / instructions.md
Last active June 1, 2018 18:37
Autocomplete Git commands in terminal
  1. Run in intermal: curl https://raw.githubusercontent.com/git/git/master/contrib/completion/git-completion.bash -o ~/.git-completion.bash
  2. Run in terminal: code ~/.bash_profile
  3. Add to .bash_profile:
if [ -f ~/.git-completion.bash ]; then
  . ~/.git-completion.bash
fi
@1forh
1forh / structure.md
Last active September 16, 2017 02:20
Angular Application - Example Folder structure
app
  dashboard
    components
      dashboard-tile
        dashboard-tile.component.ts
    containers (views)
      dashboard
        dashboard.component.ts
 models
@1forh
1forh / map.css
Last active May 24, 2018 13:36
Counties on Google Map
.map-wrapper {
width: 100%;
height: 400px;
}
@1forh
1forh / marietta-college-fb-tracking.html
Created June 8, 2016 13:44
Marietta College FB Tracking
<!-- Facebook Pixel Code -->
<script>
!function(f,b,e,v,n,t,s){if(f.fbq)return;n=f.fbq=function(){n.callMethod?
n.callMethod.apply(n,arguments):n.queue.push(arguments)};if(!f._fbq)f._fbq=n;
n.push=n;n.loaded=!0;n.version='2.0';n.queue=[];t=b.createElement(e);t.async=!0;
t.src=v;s=b.getElementsByTagName(e)[0];s.parentNode.insertBefore(t,s)}(window,
document,'script','https://connect.facebook.net/en_US/fbevents.js');
fbq('init', '838997806201490');
fbq('track', "PageView");