Feross Profile picture
30 Jun, 10 tweets, 8 min read
I've been testing #GitHubCopilot in Alpha for the past two weeks. Some of the code suggestions it comes up with are eerily good.

Here's a thread with some examples that I found surprising. Will update with new examples over time.
Here's #GitHubCopilot helping me write a function to change the <meta name='theme-color'> attribute to a random color in a loop for TheAnnoyingSite 🤣


It suggested the exact code I was going to have to look up on StackOverflow. Nice.
Here's #GitHubCopilot helping me make the first version of the inline media viewer on @Wormhole_App.

I started by rendering the media viewer for a specific file type (I used .txt randomly). For all other file types, I wanted it to "fall through" to the standard click handler.
If the file's mime type (media type) is an image, we want to use an <img> tag to render it.

#GitHubCopilot suggests the right code and sets the right value into the appropriate React state.

Then, it writes the whole next else if block for audio files too.
Here I was updating the @Speakeasy_JS website to add boilerplate for upcoming events.

#GitHubCopilot figured out the pattern of our event dates. We host them every week on Fridays and it filled in the correct date, without me needing to check a calendar.
Another @Speakeasy_JS example.

Here you can see that #GitHubCopilot figured out that the getCurrentEvent() function should either return the event, or null if the event is not valid.
Fixing a bug in a @Wormhole_App API endpoint where file extensions should be treated case-insensitively.

#GitHubCopilot suggests the correct bugfix, which is to lowercase the extension.
Making a boolean function to determine if a mime type (media type) is supported by the inline file viewer on @Wormhole_App

#GitHubCopilot suggests the right code
Adding support for text mime types (i.e. media types) on @Wormhole_App. For text files, I want to support any mime type with a "text/" prefix since there are so many.

There's no array of text media types in the code, so #GitHubCopilot suggests a more general solution:
Updating browser detection code to detect Opera on iOS and Android.

I added the code for detecting iOS opera ("opt/") and was about to add iOS Android ("opr/") next, when #GitHubCopilot offers to finish it up for me, in two stages

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with Feross

Feross Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @feross

14 Jun
Ran into a spectacularly awful Safari bug in the latest Safari (14.1.1 on macOS and iOS 14.6).

Opening an IndexedDB database fails 100% of the time on the first try. 😩

If you refresh, it starts working.

Bug report: bugs.webkit.org/show_bug.cgi?i…

cc @webkit @chris_dumez @Apple
One workaround we've found is to reference the indexedDB global early on, like this:

const idb = globalThis.indexedDB

Then later calls to `indexedDB.open()` will succeed.

If I had to guess, Safari is lazily opening the DB in another process but somehow doing it wrong.
It's really really hard to build reliable websites on macOS and iOS with showstopper bugs like this.

This should have been caught by basic unit testing.

@webkit Please prioritize this bug and release a hotfix.
Read 5 tweets
27 Apr
✅ Safari shipped blob.stream() - YAY!

❌ But it immediately crashes with a NULL pointer exception if you give it anything but a small amount of data – YIKES!

cc @webkit
Looks like this crash was fixed in a commit in January. See: bugs.webkit.org/show_bug.cgi?i…

But they still shipped the version that crashes the whole tab with a null pointer exception in Safari 14.1.

This should have been fixed before release.
We were proper web citizens and feature detected `blob.stream()` but our website completely broke in Safari 14.1 because it started using the new shipped API. The tab just instantly crashes.

Looks like we have to specifically detect Safari 14.1 now. 😔
Read 5 tweets
14 Sep 20
My friend has a @1Password Family subscription and let the credit card lapse. She didn't notice the emails asking to update the card.

1Password completely deleted her account and logged her out on all devices. Now she can't access her 100+ passwords and 2FA tokens

WTF
I feel terrible because I recommended @1Password to her as I have to countless friends over the years.

For as long as I've used 1Password, their policy was to make passwords read-only when a license or subscription expires. Never to remotely wipe your passwords as punishment
She's now been logged out and had her passwords wiped on both her Mac and iOS devices and hasn't been able to access her accounts for several days.

@1Password support - can you fix this now, please?
Read 18 tweets
3 Jun 20
I just built a site to help you make a friend in 2 minutes! My goal is to help people stuck indoors because of COVID-19 (or police curfews) to make meaningful connections with strangers. Hope you love it!

virus.cafe
Here's how it works:


1. You are matched with a random partner for a video chat
2. You're given a deep question to discuss
3. You have 2 minutes to discuss it!

The only rule is: no small talk!
Here are a few samples:

- When in your life have you been the happiest?
- What would you be willing to die for?
- What is the biggest lie you’ve told without getting caught?
- What is a belief you had as a child that you no longer have?
- What human emotion do you fear the most?
Read 11 tweets
5 Jul 18
🤯 Just read a fascinating paper called "The Surprising Creativity of Digital Evolution"

🤣 It's a bunch of HILARIOUS anecdotes showing how Artificial Life systems often produce SUPER surprising and SHOCKINGLY ridiculous results. 😲

👇 THREAD
😜 "Selection Gone Wild"

"It is often functionally simpler for evolution to just exploit loopholes in the quantitative measure than it is to achieve the actual desired outcome"
🙄 "Evolution had discovered another cheat: "somersaulting without jumping at all. ... At the start of the simulation, the individual 'kicks' the foot of its pole off the ground, and begins falling head-first, somersaulting its foot"
Read 27 tweets
4 Jun 18
My thoughts on GitHub...

Microsoft in 2018 isn't an evil monopolist anymore. They've actually invested heavily in open source, recently becoming the #1 contributor on GitHub including to many projects that are not their own (e.g. @electronjs) but there are some downsides. 1/10
Downside 1: One less independent tech company. GitHub used to be an independent advocate for open source. Now, it'll be yet another service of Big Tech Inc. Historically, companies use acquisitions to push users into their ecosystem to sell more products and services. 2/10
Acquirers often make it slightly annoying to use the acquired product with competitor ecosystems, letting integrations with competitor services languish to the point that they stop working or are removed entirely. They also might start pushing Microsoft Azure in some form. 3/10
Read 11 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal Become our Patreon

Thank you for your support!

Follow Us on Twitter!

:(