Skip to content

Instantly share code, notes, and snippets.

View amogower's full-sized avatar

andy g amogower

View GitHub Profile
@amogower
amogower / postgresql-set-id-seq.sql
Created April 29, 2024 08:36 — forked from henriquemenezes/postgresql-set-id-seq.sql
PostgreSQL set Next ID Sequence Value to MAX(id) from Table
-- Get Max ID from table
SELECT MAX(id) FROM table;
-- Get Next ID from table
SELECT nextval('table_id_seq');
-- Set Next ID Value to MAX ID
SELECT setval('table_id_seq', (SELECT MAX(id) FROM table));
@amogower
amogower / README.md
Last active March 30, 2025 19:42
MacOS Install/Uninstall Scripts

MacOS Install/Uninstall Scripts

Install

To use the install script and set up MacOS:

/bin/zsh <(curl -sL https://gist.github.com/amogower/f05554070d10cc036ba8cbc9968a954e/raw/install.sh)
function sendMoney(account, amount) {
if (account.balance < amount) {
console.log('Insufficient funds');
return;
}
if (amount <= 0) {
console.log('Invalid transfer amount');
return;
}
if (account.sender !== 'user-token') {
@amogower
amogower / 1-setup.md
Created March 20, 2022 22:29 — forked from troyfontaine/1-setup.md
Signing your Git Commits using GPG on MacOS Sierra/High Sierra

Methods of Signing with GPG

Last updated March 28, 2021

There are now two ways to approach this:

  1. Using gpg and generating keys
  2. Using Kryptonite by krypt.co

This Gist explains how to do this using gpg in a step-by-step fashion. Kryptonite is actually wickedly easy to use-but you will still need to follow the instructions

@amogower
amogower / machine.js
Created November 19, 2021 11:54
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions

Keybase proof

I hereby claim:

  • I am amogower on github.
  • I am amogower (https://keybase.io/amogower) on keybase.
  • I have a public key ASDI5asaXiHygBfjFE6SQpPmWy7CDOcgqA5-sWR_khCdDQo

To claim this, I am signing this object:

@amogower
amogower / machine.js
Created February 4, 2021 18:31
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@amogower
amogower / machine.js
Created January 19, 2021 19:06
Generated by XState Viz: https://xstate.js.org/viz
const selectionMachine = Machine({
id: 'selection',
context: {
stake: '',
},
initial: 'active',
states: {
active: {
initial: 'idle',
states: {
@amogower
amogower / machine.js
Created January 19, 2021 19:06
Generated by XState Viz: https://xstate.js.org/viz
const singleMachine = Machine({
id: 'single',
initial: 'winOnly',
context: {
stake: '',
},
states: {
winOnly: {
id: 'winOnly',
initial: 'idle',
@amogower
amogower / machine.js
Created January 19, 2021 19:06
Generated by XState Viz: https://xstate.js.org/viz
const singleBetMachine = Machine({
id: 'singleBet',
initial: 'default',
context: {
isEachWay: false,
stake: '',
},
states: {
default: {
on: {