Skip to content

Instantly share code, notes, and snippets.

View hamlim's full-sized avatar
💻
Working on side projects

Matt Hamlin hamlim

💻
Working on side projects
View GitHub Profile
class ListNode {
constructor(val = 0, next = null) {
this.value = val;
this.next = next;
}
}
let listA = new ListNode(2, new ListNode(4, new ListNode(3)));
let listB = new ListNode(5, new ListNode(6, new ListNode(4)));
@hamlim
hamlim / input.scss
Last active April 1, 2021 22:43
Generated by SassMeister.com.
// Replace function to locate and replace the `#` in the hexcode from the color variables with `%23`
// `%23` is the html entity for `#` used for the fill hexcode in the data uri
// https://www.chromestatus.com/features/5656049583390720
// https://css-tricks.com/snippets/sass/str-replace-function/
// $string - Initial string
// $search - Substring to replace
// $replace ('') - New value
@function str-replace($string, $search, $replace: '') {
$index: str-index($string, $search);
type Cache = Map<string, any>
type Loader = (key: string) => Promise<any>
enum Status {
Pending,
Resolved,
Rejected,
}
interface Resource {
status: Status
value: Promise<any>
@hamlim
hamlim / reroute.tsx
Created July 10, 2020 22:56
Reroute Core and Reroute Dom (formerly Reroute Browser)
// ~~ reroute ~~
type Location = {
pathname: string
}
let {
createContext,
useContext,
useState,
useMemo,
@hamlim
hamlim / .prettierrc.js
Created May 10, 2020 14:35
Prettier Config
module.exports = {
singleQuote: true,
trailingComma: 'all',
semi: false,
bracketSpacing: true,
tabWidth: 2,
proseWrap: 'always',
}
@hamlim
hamlim / for-snook.md
Created December 10, 2019 03:56 — forked from threepointone/for-snook.md
For Snook

https://twitter.com/snookca/status/1073299331262889984?s=21

‪“‬In what way is JS any more maintainable than CSS? How does writing CSS in JS make it any more maintainable?”

‪Happy to chat about this. There’s an obvious disclaimer that there’s a cost to css-in-js solutions, but that cost is paid specifically for the benefits it brings; as such it’s useful for some usecases, and not meant as a replacement for all workflows. ‬

‪(These conversations always get heated on twitter, so please believe that I’m here to converse, not to convince. In return, I promise to listen to you too and change my opinions; I’ve had mad respect for you for years and would consider your feedback a gift. Also, some of the stuff I’m writing might seem obvious to you; I’m not trying to tell you if all people of some of the details, but it might be useful to someone else who bumps into this who doesn’t have context)‬

So the big deal about css-in-js (cij) is selectors.

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

Reach UI Philosophy

Reach UI is an accessible foundation for React applications and design systems.

The three equally important goals are to be:

  • Accessible
  • Composable
  • Stylable
Number.prototype.to = function*(n) {
let finish = n.valueOf();
let start = this.valueOf();
let finishLessThan = start >= finish;
for (
let i = start;
finishLessThan ? i >= finish: i <= finish;
i += finishLessThan ? -1 : +1
) yield i;
};
@hamlim
hamlim / mac-setup.md
Created May 5, 2019 19:42
A collection of utilities I use on my mac