Sampson Profile picture
Webmaster since the mid-90's. The Office. Microsoft Alumni. 4th Stack Overflow Mod. Jesus, JavaScript, and Jiu-Jitsu. Making a better Web @brave 🇺🇸🇧🇷
Oct 2, 2020 5 tweets 1 min read
WordPress, for all the good it has done, simply cannot help but to screw up the simplest things.

<pre>\\.well-known</pre>

In walks WordPress, "Oh, let me quadruple those backslashes for you."

So I try &#92;, which WordPress then converts into &amp;#92;!

I just can't win here. Yes, I know to make changes in the TEXT view, and not the Visual view. Tragically, that will give you all sorts of [other] problems, like randomly eating carriage-returns, or inserting a <br> here and there. This utility simply isn't cut-out for sharing code(-like) content.
Oct 2, 2020 4 tweets 1 min read
Never again will I call the split method on a string to get an array of characters. From here on out, it's spread all the way 🙂

[...string].map( char =>
char.charCodeAt(0).toString(16)
);

Much nicer than string.split(""), in my opinion. Function with empty string? No thanks! Now, if only I could convert an array of character strings back to a string without needing to call array.join(""), I'd be set.

I could reduce, but, yuck...

array.reduce( ( s, c ) => s += c, '' )
Sep 26, 2020 5 tweets 1 min read
Windows uses values 0D 0A to signify a line-break. Mac uses 0A.

TIL—Windows XP had a bug causing Notepad to insert 0D 0D 0A. It wouldn't save like that, but if you copied and pasted the contents elsewhere the bytes could be preserved to this day.

Computers are hard 🙂 Oh, wait... does Windows 10 use 0A now?

`a
b`.split('').map(x => x.charCodeAt(0).toString(16))

Which produces

["61", "a", "62"]

Or maybe this is JavaScript normalizing it?
Sep 26, 2020 6 tweets 2 min read
D'oh! Working with React and wondered why my UI was partial:

render () {
return (
<A prop={value} />,
<B prop={value} />
)
}

Reminded me how cool the comma operator is in JavaScript:

return Expr, …, Expr

Evaluates each expression, but returns result of last. Ti be more clear, the return statement returns the result of the Expression (if any) to its right. Expressions can contain Expressions. So each of the expressions in a list are evaluated, but only the result of the final is returned.
Sep 22, 2020 10 tweets 4 min read
The Accident: A Short Story

In 1992 Phillip Hallam-Baker and Tim Berners-Lee were developing HTTP. Phillip suggested a request header to record the URI of the linking-document, and "referer" (a spellcheck failure) was born. Servers now knew what site sent you their way. In 1993 a young developer working on the Mosaic browser added support for inline images. Before this, images could only be linked from a page and viewed separately. Images from remote servers were supported as well, and requests for them would eventually include a referer header.
Sep 16, 2020 6 tweets 2 min read
Over the years there have been various ways to sniff the user's web history with CSS and JavaScript. For example, generating 10,000 links & checking their color (visited differs by default). These are now blocked, but I wonder how often advertisers and exchanges engaged in this. Clever developers would adapt to these changes, turning their focus from the links to the style of adjacent elements with :visited + span, and then reading span's computedStyle to see how it looks. Background images could be used in a similar manner; listen for what loads.
Sep 10, 2020 5 tweets 2 min read
TIL dangerouslySetInnerHTML is React's way of pushing back when developers wish to set innerHTML on an element.

Reminds me of toStaticHTML and execUnsafeLocalFunction from Windows 8 Apps.

jQuery wasn't compatible initially; I was able to contribute fixes. jQuery had a cool HTML-cleanup routine. It would construct an ad-hoc DIV, pass HTML input into div.innerHTML, and then read it back out; it used the browser's parser to clean-up the user-provided source.

But when you'd include jQuery into your Windows 8 app, all sorts of alarms!
Aug 28, 2020 4 tweets 1 min read
New 5-year plan, learn to play the piano. Life is too short, I have to feel just a fraction of what it's like to be lost in the music like Khatia Buniatishvili or Martha Argerich. I am doing a disservice to myself if I don't chase that experience 🙂 Progress is progress at the end of the day. I am tempted to find a coach, but for now YouTube is a major help. Day 2 of really trying to learn to play the piano. Every wrong note plays a little louder when it's your own 😂
Aug 5, 2020 9 tweets 4 min read
Music you can feel. Music which changes you. Music that pulls you away from the mundane and silly obsessions of this World. Music that opens your eyes to that which matters most. Now that's good music.

It's a country-music-YouTube evening over here in the home office 🙂 Brooks & Dunn - Believe (Official Video) via @YouTube
Jul 23, 2020 5 tweets 2 min read
I have no idea why I'm sharing this, but:

WinZip in 1997—$29*.
WinZip in 2020—$29.95.

Also, years ago I sat next to a WinZip engineer on a flight. Couldn't believe it. WinZip was everything in the 90s 🙂

*$30.74 for Connecticut residents, who had to add a 6% sales tax. Image The WinZip homepage in 1999. Unfortunately the images were not cached on the Wayback Archive for any earlier versions. Image
Jul 16, 2020 4 tweets 1 min read
Nick, you said white people were biologically predisposed to acting more like animals. There are better ways to uplift your community. You don't have to dehumanize some to show compassion for others. It's not a zero-sum game, my friend. I'd also like to say that you spoke with great conviction and passion when you said white people lack compassion ("due to [our] lack of melanin"), and act more like animals. I can't see such a deeply-held belief being abandoned over night, short of a miraculous encounter.
Jul 15, 2020 7 tweets 10 min read
Somebody has gained access to accounts like @coinbase, @Gemini, @binance, @cz_binance, and more, and is sharing scam links. This is an impressive effort; and these aren't leveraging third-party services with keys either. They're going through the Twitter Web App service. Image @coinbase @Gemini @binance @cz_binance What is going on!? Now @justinsuntron and @Tronfoundation have been compromised too. Somebody must have been sitting on account access for quite a while. This is an impressive list of accounts. There are many, many more, but I'm only filtering above an engagement threshold.
Jun 6, 2020 38 tweets 13 min read
I’m only a few pages into Booker T. Washington’s book (My Larger Education), but his attitude and perspective were amazing. On dealing with rude/racist people: “I learned from this experience that it takes no more time to be polite to every one than it does to be rude.” Image Booker T. Washington on the importance of voting, working with local law enforcement, and doing good work (even when nobody is there to give you praise). Image
May 7, 2020 15 tweets 16 min read
So, YouTube SUGGESTED I visit Wozniak's channel on YouTube where he's giving a talk on Bitcoin, Artificial Intelligence, and more. 8K viewers.

Oh, and this isn't Woz's channel. He's not presenting live. This entire thing is a scam designed to steal people's Bitcoin. Thanks, YT. Image Fortunately, it looks like nobody has contributed anything. Also, I wonder if it was hard to get an address that starts with 1Woz in this case; kinda clever 🙂 Channel 'About' page has earlier channel icon and location. ImageImage
Apr 30, 2020 31 tweets 7 min read
One of my first jobs was detasseling corn. I'd wake up before dawn, ride out to a farm, and work until mid-day. I think I made about $4.50/hr at the time. Didn't matter. Come Friday, I felt like a million bucks. I remember the joy of buying a pair of shorts with my own money 🙂 My buddy got me a job working the local melon fields from time to time too. Two jobs meant two incomes 🙂 This was around the time I managed to get my first computer. Loved it so much I took my savings and helped buy a friend [his] first computer, just so we could share that joy.
Apr 18, 2020 4 tweets 2 min read
It's kind of absurd I have to pay for domain privacy these days. Imagine if email providers would expose the name, address, and phone number of account holders unless they paid extra for the "protection". Alright. Everybody is saying I should move to @Namecheap. Anybody from there able to assist me in making the transition?
Mar 21, 2020 6 tweets 2 min read
Are people peddling fake masks on Amazon, aiming to take advantage of buyers during COVID-19? It's odd that they're breaking-up words like "mask" and "respirator" like this. I can only assume they're trying to evade checks by Amazon. Image More bizarre Coronavirus-related listings on Amazon. This listing is of a set of N95 Masks, categorized as various media types. What is going on here? Image
Aug 27, 2019 14 tweets 7 min read
Curious what happens when Safari launches with a new profile? Me too, so I fired up a proxy, and watched.

Here is what I found… To kick this thread off, lets take a close look at that initial loading screen. For setup, I temporarily set aside the Library/Safari folder, thus giving myself a fresh profile on the subsequent launch. Check out those icons. Where do you think they're hosted/stored?
Aug 27, 2019 25 tweets 14 min read
What happens when you install the Edge (Chromium) Beta build and run it for the first time? I was curious.

On first-run, Edge fired off 130+ requests to nearly 50 endpoints. Here they are, sorted by total calls.

Time to take a closer look. Here are all of the sessions for the 4 minutes or so I let the browser run. I see numerous connections to MSFT properties, but connections to non-MSFT properties too: Google APIs, Google, Double Click, Google Ad Services, Facebook, Twitter Ads, and more.
Aug 26, 2019 21 tweets 10 min read
What happens when you launch a fresh install of Firefox? I was curious, so I did so with version 68.0.2, and monitored my network activity.

Here's what I learned… Note, this doesn't involve any interaction beyond opening the browser and waiting a few minutes.

What I found were dozens of requests, which loaded nearly 16 MB in data. Lets break down what I saw.
Aug 25, 2019 16 tweets 8 min read
What happens when you launch Google Chrome for the first time on a Windows 10 machine?

When I launched Google Chrome for the first time (and let it sit for a minute), 32 requests were made, and 7.26 MB of data downloaded. The first call Chrome makes is to the googleapis domain. It passes my OS type, browser channel (Stable), and version (v76) along. The response is 32KB of flags, features, and more. Not clear what they all do (as many can't be found in Chromium source) but some are fairly clear.