Skip to content

Instantly share code, notes, and snippets.

@weivall
weivall / meta-tags.md
Created July 7, 2023 15:50 — forked from whitingx/meta-tags.md
Complete List of HTML Meta Tags

Copied from http://code.lancepollard.com/complete-list-of-html-meta-tags/

Basic HTML Meta Tags

<meta charset='UTF-8'>
<meta name='keywords' content='your, tags'>
<meta name='description' content='150 words'>
<meta name='subject' content='your website's subject'>
<meta name='copyright' content='company name'>
@weivall
weivall / reset.css
Created February 5, 2022 21:15 — forked from simonausten/reset.css
Email CSS Reset
<style type="text/css">
/****** EMAIL CLIENT BUG FIXES - BEST NOT TO CHANGE THESE ********/
.ExternalClass {
width: 100%;
}
/* Forces Outlook.com to display emails at full width */
.ExternalClass, .ExternalClass p, .ExternalClass span, .ExternalClass font, .ExternalClass td, .ExternalClass div { line-height: 100%; }
/* Forces Outlook.com to display normal line spacing, here is more on that: http://www.emailonacid.com/forum/viewthread/43/ */
@weivall
weivall / gist:d306e9a7b7a23024cd50dc93f97251d4
Created September 9, 2020 10:08
React HTTPS with custom cert
"start": "export HTTPS=true&&SSL_CRT_FILE=cert.pem&&SSL_KEY_FILE=key.pem react-scripts start",
@weivall
weivall / har.js
Created May 1, 2020 18:16
HAR in puppeteer
const fs = require('fs');
const { promisify } = require('util');
const puppeteer = require('puppeteer');
const { harFromMessages } = require('chrome-har');
// list of events for converting to HAR
const events = [];
// event types to observe
@weivall
weivall / partial_range_update.sql
Created April 25, 2020 13:02 — forked from karanlyons/partial_range_update.sql
Postgres: Update only portion of range, preserving other half and bounds.
UPDATE <TABLE> SET
<COLUMN>=<RANGE_TYPE>(
lower(<COLUMN>), -- Swap out for actual value
upper(<COLUMN>), -- Swap out for actual value
concat(
CASE WHEN lower_inc(<COLUMN>) THEN '[' ELSE '(' END,
CASE WHEN upper_inc(<COLUMN>) THEN ']' ELSE ')' END
)
)
WHERE <CONDITION>;
// store.js
import React, { createContext, useContext, useReducer } from 'react';
const StoreContext = createContext();
const initialState = {count: 0, message: ""};
const reducer = (state, action) => {
switch(action.type) {
case "increment":
return {
# vi: tw=2 ts=2 sw=2
version: '3.7'
services:
db-remote:
build:
context: var/ssh
container_name: ssh-tunnel
restart: always
@weivall
weivall / dump-restore
Created November 7, 2019 14:58 — forked from ricjcosme/dump-restore
DUMP / RESTORE PostgreSQL Kubernetes
DUMP
// pod-name name of the postgres pod
// postgres-user database user that is able to access the database
// database-name name of the database
kubectl exec [pod-name] -- bash -c "pg_dump -U [postgres-user] [database-name]" > database.sql
RESTORE
// pod-name name of the postgres pod
// postgres-user database user that is able to access the database
// database-name name of the database
@weivall
weivall / gist:77dd9822e9ec161b1ef4fadafa11fba1
Created June 28, 2019 15:32
Create macOS (Mojave) iso
hdiutil create -o /tmp/Mojave.cdr -size 6200m -layout SPUD -fs HFS+J
hdiutil attach /tmp/Mojave.cdr.dmg -noverify -mountpoint /Volumes/install_build
sudo /Applications/Install\ macOS\ Mojave.app/Contents/Resources/createinstallmedia --volume /Volumes/install_build
mv /tmp/Mojave.cdr.dmg ~/Desktop/InstallSystem.dmg
hdiutil detach /Volumes/Install\ macOS\ Mojave
hdiutil convert ~/Desktop/InstallSystem.dmg -format UDTO -o ~/Desktop/Mojave.iso