Skip to content

Commit 1a89e04

Browse files
committed
nintype post
1 parent 3a37841 commit 1a89e04

File tree

3 files changed

+41
-44
lines changed

3 files changed

+41
-44
lines changed

app/lib/get-posts.ts

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,22 @@ import matter from 'gray-matter'
22
import { Octokit } from '@octokit/rest'
33
import type { Post } from './types'
44
import { cache } from 'react'
5-
// import supabase from '@lib/supabase/private'
65
import { promises as fs } from 'fs'
76

8-
// const octokit = new Octokit({
9-
// auth: process.env.GITHUB_TOKEN,
10-
// request: {
11-
// fetch,
12-
// },
13-
// })
14-
157
// save octokit to global if exists, otherwise create new instance and save to global
16-
const octokit = global.octokit ?? new Octokit({
17-
auth: process.env.GITHUB_TOKEN,
18-
request: {
19-
fetch,
20-
},
21-
})
22-
8+
const octokit =
9+
// @ts-ignore - octokit is not defined
10+
global.octokit ??
11+
new Octokit({
12+
auth: process.env.GITHUB_TOKEN,
13+
request: {
14+
fetch,
15+
},
16+
})
17+
18+
// @ts-ignore - octokit is not defined
2319
if (!global.octokit) {
20+
// @ts-ignore - octokit is not defined
2421
global.octokit = octokit
2522
}
2623

@@ -43,22 +40,23 @@ const getPosts = cache(async () => {
4340
const repoName = 'maxleiter.com'
4441
const postsDir = 'posts'
4542

46-
if (process.env.NODE_ENV === "development") {
43+
if (process.env.NODE_ENV === 'development') {
4744
const posts = await Promise.all(
48-
(await fs.readdir(`${process.cwd()}/posts`)).map(async (file) => {
45+
(
46+
await fs.readdir(`${process.cwd()}/posts`)
47+
).map(async (file) => {
4948
const postContent = await fs.readFile(
5049
`${process.cwd()}/posts/${file}`,
5150
'utf8'
5251
)
5352
const { data, content } = matter(postContent)
5453
return { ...data, body: content } as Post
55-
}
56-
))
54+
})
55+
)
5756

5857
return posts.sort((a, b) =>
5958
a && b ? new Date(b.date).getTime() - new Date(a.date).getTime() : 0
6059
) as Post[]
61-
6260
}
6361

6462
const { data: files } = (await octokit.repos.getContent({

app/lib/types.d.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,3 @@ export type Project = {
1717
years: string[]
1818
stars?: number
1919
}
20-
21-
declare global {
22-
// eslint-disable-next-line no-unused-vars
23-
namespace NodeJS {
24-
// eslint-disable-next-line no-unused-vars
25-
interface Global {
26-
octokit: Octokit
27-
}
28-
}
29-
}

posts/nintype.mdx

Lines changed: 23 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,10 @@
22
title: Nintype is still the best iOS keyboard
33
description:
44
slug: nintype
5-
date: May 21, 2023
6-
published: false
5+
date: May 22, 2023
76
---
87

9-
Nintype is hard to explain. Here's a the demo video from back in 2014:
8+
Describing Nintype is a challenge. Here's a the demo video from it's launch back in 2014:
109

1110
<div style={{ margin: 'auto', maxWidth: '500px', height: '300px' }}>
1211
<iframe
@@ -25,8 +24,11 @@ Nintype is hard to explain. Here's a the demo video from back in 2014:
2524
<i>"the true touch typing experience"</i>
2625
</small>
2726

28-
Basically, it's a keyboard that lets you seamlessly swipe and type (at the same time) with two thumbs. It might not sound impressive, but it's crazy.
29-
It let's you type _fast_, and it's a joy to use once you get over the somewhat steep learning curve. Seriously, here's my friend texting me about it back in 2015 (sorry for the expletives):
27+
Essentially, Nintype is a keyboard that enables you to type and swipe simultaneously using both thumbs.
28+
This might not seem too crazy at first, but trust me, it's impressive.
29+
It allows for swift typing that, despite its somewhat steep learning curve, is a pleasure to use.
30+
It's a piece of software that feels like magic, and that's hard to come by.
31+
Look how my friend texted me when we were first discovering it (apologies for the expletives):
3032

3133
<img
3234
src="/blog/nintype/text.png"
@@ -35,22 +37,19 @@ I'm really fucking excited"
3537
style={{ maxWidth: '350px', margin: 'auto' }}
3638
/>
3739

38-
To this day, I haven't found a keyboard that comes close to Nintype's feature set
39-
and implementation. Thankfully, after breaking sometime before iOS 11, iOS 12 brought
40-
it back to life and you can stil [use it today](https://apps.apple.com/us/app/nintype/id796959534), at least on iOS.
41-
4240
It's genius lies in a few things:
4341

4442
## Swipe and type
4543

46-
The true secret sauce of Nintype is that you can mix-and-match your swiping and typing at the same time. If you need to double tap a word, like "I'll", you can swipe the first half of the word, and then double tap the "l" key to finish the word.
47-
It's hard to explain, but it's intuitive and unlocks a lot of speed. I can consistently reach above 100 <abbr title="words per minute">WPM</abbr> with ~95-97% accuracy using Nintype.
44+
Nintype's true magic lies in it's ability to understand swiping and tapping with both fingers simultaneously.
45+
If you need to double tap a word, like "I'll", you can swipe the first half of the word, and then double tap the "l" key to finish the word.
46+
It's a bit tricky to put into words, but it feels intuitive and unlocks a lot of speed. I can consistently reach 100 <abbr title="words per minute">WPM</abbr> with ~90-95% accuracy using Nintype.
4847

4948
## Customization
5049

5150
Nintype has options for seemingly everything.
52-
You can add custom shortcuts (like filling your email or credit card number), customize (and disable) the colors/animations, and generally [rice](https://www.reddit.com/r/unixporn/wiki/themeing/dictionary#wiki_rice) the heck out of it.
53-
Here's are some screenshots covering (a fraction of) the menu options:
51+
You can add custom shortcuts (such as auto filling your email or credit card number), customize (and disable) the colors/animations, and generally [rice](https://www.reddit.com/r/unixporn/wiki/themeing/dictionary#wiki_rice) the heck out of it.
52+
Here's are two screenshots covering most of the menu options:
5453

5554
{/* flex box to show them side by side on desktop and vertically if needed */}
5655

@@ -78,4 +77,14 @@ Here's are some screenshots covering (a fraction of) the menu options:
7877

7978
## Autospace
8079

81-
Autospace was the most difficult feature for me to embrace, but it's important
80+
Autospace was the most difficult feature for me to embrace, and that's because I overused it.
81+
I expected it to keep up with my typing speed, but it's not meant to do that; it waits for your pauses and then adds spaces. If you're typing quickly, you don't really pause.
82+
Now, I leave it enabled and manually hit the space key when needed, especially when typing with one hand or taking my time, and I love it.
83+
84+
## It still works today
85+
86+
In a testament to it's great design and engineering, Nintype is functionally the same as it was in 2014 (despite a brief hiatus when it broke on iOS 14) and continues to be the best keyboard I've ever used.
87+
I wonder why the iOS keyboard and others only support single-swipe typing; it's a shame and a missed opportunity.
88+
89+
You can find Nintype on the App Store [here](https://apps.apple.com/us/app/nintype/id796959534).
90+
If you use Android, I'm sorry &mdash; it seems like it was removed from the Play Store [sometime last year](https://www.reddit.com/r/nintype/comments/s4sx1b/looks_like_keyboard_69_nintype_has_been_removed/).

0 commit comments

Comments
 (0)