Skip to content

Instantly share code, notes, and snippets.

View JamieMason's full-sized avatar

Jamie Mason JamieMason

View GitHub Profile
@JamieMason
JamieMason / delete-whatsapp-messages.js
Last active June 1, 2024 23:23
Bulk Delete every WhatsApp Chat Message
// Delete every Chat in WhatsApp, by Jamie Mason (https://twitter.com/fold_left)
// https://gist.github.com/JamieMason/f8992ebf95423244b730b2c393c321ef
//
// 1. Go to https://web.whatsapp.com/ and sign in.
// 2. Archive any messages you don't want deleting, you can unarchive them after.
// 3. Open the Developer Console. (COMMAND+ALT+I on Mac)
// 4. Paste this into the Developer Console and run it.
// 5. If it gets stuck, scroll up and down in the list of chats.
// 6. Refresh the page and run again if you have any problems.
// 7. This Script does not Exit Groups or clear messages in them.
@JamieMason
JamieMason / copy-names-of-all-github-issue-labels.md
Created August 20, 2020 14:40
Copy names of all GitHub Issue Labels
@JamieMason
JamieMason / next.config.js helpers.md
Last active August 12, 2020 13:22
next.config.js helpers

next.config.js Helpers

Mutate next.js internal config to make changes which are not officially available to you. Be sure to know what you're doing.

Helpers

const getPluginsByConstructorName = (constructorName, plugins) =>
  plugins.filter((plugin) => plugin.constructor.name === constructorName);
@JamieMason
JamieMason / machine.js
Last active July 28, 2020 11:07
Generated by XState Viz: https://xstate.js.org/viz
// @TODO: Handle US Taxes
// @TODO: Handle Abandoned Checkout
// @TODO: Handle guest checkout
// @TODO: What/when do we tell PayPal when a gift card is redeemed?
// @TODO: What/when do we tell PayPal when a coupon code is redeemed?
// @TODO: Handle when to mount and unmount the paypal library/iframe safely
// @TODO: Include how we handle errors
// @TODO: What side-effects do we need to fire and when?
// @TODO: What response data do we need to store from requests and when?
// @TODO: Loqate?
@JamieMason
JamieMason / machine.js
Last active July 28, 2020 08:08
Generated by XState Viz: https://xstate.js.org/viz
// @TODO: handle US Taxes
// @TODO: handle guest checkout
// @TODO: what/when do we tell PayPal when a gift card is redeemed?
// @TODO: what/when do we tell PayPal when a coupon code is redeemed?
// @TODO: handle when to mount and unmount the paypal library/iframe safely
// @TODO: include how we handle errors
// @TODO: what side-effects do we need to fire and when?
// @TODO: what response data do we need to store from requests and when?
// @TODO: Loqate?
// @TODO: Redeeming Coupons - this can be done at any stage of checkout
@JamieMason
JamieMason / inline-styles.md
Created July 23, 2020 11:56
Inline all user-defined styles on an Element and its descendants

Inline all user-defined styles on an Element and its descendants

A lot of styles can depend on context, such as .foo a so this doesn't work brilliantly.

var toCamelCase = (str) =>
  str
    .split("-")
    .map((word, index) =>
      index == 0
@JamieMason
JamieMason / machine.js
Last active July 13, 2020 15:21
Generated by XState Viz: https://xstate.js.org/viz
const formMachine = Machine(
{
id: 'form',
initial: 'editing',
context: {
apiError: '',
formSchema: null,
formData: null,
},
states: {
@JamieMason
JamieMason / machine.js
Last active July 13, 2020 10:53
authMachine: Generated by XState Viz: https://xstate.js.org/viz
const loginMachine = Machine(
{
id: 'login',
initial: 'idle',
context: {
apiError: '',
email: '',
fieldError: '',
password: '',
shouldRememberMe: false,
@JamieMason
JamieMason / machine.js
Last active July 13, 2020 10:52
checkoutMachine: Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
// - XState (all XState exports)
@JamieMason
JamieMason / machine.js
Last active July 12, 2020 09:39
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
// - XState (all XState exports)