Skip to content

Instantly share code, notes, and snippets.

@areohbe
areohbe / new_macos_machine_setup.md
Last active December 6, 2025 17:32 — forked from GLMeece/new_macos_machine_setup.md
New macOS Machine Setup

New macOS Machine Setup

Most of the setup will use the terminal. For more details on how to setup an awesome terminal experience on the Mac, see my guide Steps to Terminal Enlightenment on a Mac (tweaking your terminal for fun and profit), which in fact includes some of these steps (you're welcome!).

Verify or Install Apple's Command-line Tools

First, make sure that you have Apple's command-line tools installed by executing:

xcode-select -p
@areohbe
areohbe / machine.js
Last active June 6, 2021 22:39
Generated by XState Viz: https://xstate.js.org/viz
const fetchMachine = Machine({
id: "powerUp",
initial: "inactive",
context: {
count: 0,
selected: {
sender: undefined,
filter: undefined
},
filters: undefined,

Keybase proof

I hereby claim:

  • I am areohbe on github.
  • I am areohbe (https://keybase.io/areohbe) on keybase.
  • I have a public key ASDU2EiSBFB9TiOGKnjUsgXj1H6y0AHVPaliwZ6pZbgEygo

To claim this, I am signing this object:

@areohbe
areohbe / local-timezone.sql
Created April 8, 2017 02:22
Convert an event time to a user's local time zone by state in postgres
--Case statement covnert user generated events to the user's local time zone based on a user's state
--Best used when your date/time field is stored as a timestampz, time zone aware, value in postgres
--For states that have more than one time, the time zone with the largest population is used.
--Exmaple use case: figuring out what percentage of user generated events take place outside of buiness hours
--Replace 'state' and 'event_time' with the respective columns names from your postgres database.
case
when state in ('CT','DE','DC','FL','GA','IN','KY','ME','MD','MA','MI','NH','NJ','NY','NC','ND','OH','PA','RI','SC','VT','VA','WV') then event_time at time zone 'us/eastern'
when state in ('AR','IL','IA','KS','LA','MN','MS','MO','MT','NE','OK','SD','TN','TX','WI') then event_time at time zone 'us/central'