Skip to content

Instantly share code, notes, and snippets.

View tyre's full-sized avatar

Chris Maddox tyre

View GitHub Profile
@tyre
tyre / README.md
Created July 26, 2023 21:32
NOOOOOOOOOOde

pnpm dlx ts-node boop.ts --verbose

Today President Obama released an important update to overtime regulation. We're big employment regulation nerds at Gusto—as well we should be!—so we thought we would give you the full run down. Read on for more on what's changing, why, and what this means for both employees and employers.

By the numbers

For the first time since 2004 (12 years!) the US Department of Labor will raise the salary cap for overtime qualification. That means that any hours worked beyond forty in a week would be paid at 1.5 times an employee's hourly rate. Prior to today, only employees earning less than $23,660 per year or $455 per week automatically qualified for overtime pay.

Today, that salary cap goes up to $47,476 per year or $913 per week.[1] As long as an employee's earnings stay below that cap, any hours worked beyond 40 in a week has to be paid at 1.5 times their hourly rate.

And don't worry, if all of this sounds complicated to keep track of and calculate, Gusto has your back. We automatically track and calculate

import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
petWalruses: [
{name: "Frank"},
{name: ""},
{name: "Jean"},
{name: "Shirley"}
],

@comaddox Question for the philosopher: If you give a congrats on Twitter to someone who is not on Twitter, did you give a congrats?

Great question! This stems from George Berkeley's A Treatise Concerning the Principles of Human Knowledge. The root of it comes down to whether we can truly say something exists without direct experience of it. In the case of whether an unheard tree falling in the forest makes a sound, the answer is no. It makes vibrations, which would be percieved as sound were someone listening.

Now to your question. What is the essence of a congratulations? In your case, the congratulations is heard, just not by she who is being congratulated. Does that matter? Perhaps. As a consequentialist, I would ask you what your intention was. It seems there could be three possibilities (and likely more):

defmodule BitReader do
def puts_bits(bits) do
bit_string = accumulate_bits(bits)
|> Enum.join(", ")
IO.puts "<<#{bit_string}>>"
end
defp accumulate_bits(bits) do
accumulate_bits(bits, [])
end
defmodule RequiredFields do
defmacro __using__(_opts) do
quote do
def new(attributes) do
Map.merge(%__MODULE__{}, attributes)
|> validate
end
def validate(struct) do
missing = missing_attributes(struct)

Binary/Bitstring Matching

Introduction

Binary matching is a powerful feature in Elixir that is useful for extracting information from binaries as well as pattern matching. This article serves as a short overview of the available options when pattern matching and demonstrates a few common usecases.

Uses

Binary matching can be used by itself to extract information from binaries:

def render_with_spacer([], _template, _var_key, _spacer_template) do
nil
end
def render_with_spacer([h], template, var_key, _spacer_template) do
render template, var_key => h
end
def render_with_spacer([h|rest], template, var_key, spacer_template) do
render template, var_key => h
@tyre
tyre / gist:e756f27ca8a8bab7f745
Created January 17, 2015 23:55
Readings from Interpersonal Dynamics (AKA "Touchy Feely")
"Words Can Be Windows or Walls" in Concepts and Controversy in Organizational Behavior – Marshall Rosenberg
"Asymmetries: Women and Men Talking at Cross Purposes", Chapter 1 in You Just Don't Understand: Women and Men in Conversation – Deborah Tannen
"Good Communication That Blocks Learning" by Chris Argyris in the July/August 1994 Harvard Business Review
The Relationship Cure by John M. Gottman and Joan DeClaire
"Support: Creating a Climate for Growth", in Chapter 8 of Encounter: Group Process for Intermpersonal Growth – Gerard Egan
"Have your Feelings (Or they will have you)", Chapter 5 of Difficult Conversations – Douglas Stone, Bruce Patton, Sheila Heen
url = "https://google.com/:bubbles/frosted"
# We want "/:bubbles/" to match, but not "/:bubbles_waffle/" to match
regex = ~r/(\/|\a)\:bubbles(\/|\Z)/
# Sad Times!
# Expect ":bubbles" to be replaced with "33"
String.replace url, regex, "\\133\\2"
# => "https://google.com/frosted"