Skip to content

Instantly share code, notes, and snippets.

View andrw's full-sized avatar
🫶

Andrew Yang andrw

🫶
  • Seattle, WA
View GitHub Profile
@andrw
andrw / gist:04d46195c971289f634f14ef8a48dd1f
Created August 1, 2023 19:26
is first day of month with go time
func isFirstDayOfMonth(someRuntime time.Time) bool {
currentYear, currentMonth, _ := time.Now().Date()
currentLocation := time.Now().Location()
firstOfMonth := time.Date(currentYear, currentMonth, 1, 0, 0, 0, 0, currentLocation)
secondOfMonth := firstOfMonth.Add(24* time.Hour) // multiple ways to get here...
// within first day
if someRuntime.After(firstOfMonth) && someRuntime.Before(secondOfMonth) {
return true
@andrw
andrw / Rename Tab Bookmarklet
Created May 25, 2023 17:51
Quick bookmarklet script to rename a tab locally.
javascript:void(document.title = window.prompt("New tab name:",document.title));
{"shipping_options":[{"service":"Flat Rate - Fixed","cost":5,"reference":"flatrate_flatrate","tax_amount":0},{"service":"Free Shipping - Free","cost":0,"reference":"freeshipping_freeshipping","tax_amount":0}],"tax_result":{"amount":0}}

Stevey's Google Platforms Rant

I was at Amazon for about six and a half years, and now I've been at Google for that long. One thing that struck me immediately about the two companies -- an impression that has been reinforced almost daily -- is that Amazon does everything wrong, and Google does everything right. Sure, it's a sweeping generalization, but a surprisingly accurate one. It's pretty crazy. There are probably a hundred or even two hundred different ways you can compare the two companies, and Google is superior in all but three of them, if I recall correctly. I actually did a spreadsheet at one point but Legal wouldn't let me show it to anyone, even though recruiting loved it.

I mean, just to give you a very brief taste: Amazon's recruiting process is fundamentally flawed by having teams hire for themselves, so their hiring bar is incredibly inconsistent across teams, despite various efforts they've made to level it out. And their operations are a mess; they don't real

alert("hello andrew");
init() {
let monthYear = Calendar.current.dateComponents([.year, .month], from: Date())
_startOfMonth = State(initialValue:
Calendar.current.date(from:
DateComponents(year: monthYear.year,
month: monthYear.month))!)
_endOfMonth = State(initialValue:
Calendar.current.date(from: DateComponents(year: monthYear.year, month: monthYear.month!+1))!)
_predicate = State(initialValue: NSPredicate(format: "date >= %@ AND date <= %@", startOfMonth as NSDate, endOfMonth as NSDate))
}