Giter VIP home page Giter VIP logo

coderacer's Introduction

coderacer's People

Contributors

mfbx9da4 avatar paoloricciuti avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

paoloricciuti

coderacer's Issues

Realistic Key Processing.

It would be better to have to press enter at the end of lines and backspaces for each typo. To not get into the habit of not having to do those things.

Websocket server crashing

I was looking at the code of the websocket server because as mentioned in #4 i was experiencing crashes in a particular situation (i was closing the browser after the new race was created)

looking at the code here

try {
const result = await methods[fn](...args)
chan.postMessage({ result, requestId })
} catch (error) {
chan.postMessage({ error, requestId })
}

if the actual error is on

chan.postMessage({ result, requestId })

it will also fail on line

chan.postMessage({ error, requestId })

it should be a quite simple fix surrounding the second post message with a try catch too (this should at least prevent the server from crashing).

I think deno it's probably restarting every times it crashes and this would prevent this behavior.

If you want i can add a this in #4

Not deteclting backtick on windows

I've tryed playing but got stuck on a backtick despite writing the good character combination to get the backtick in Windows.

I would have tryed to reproduce but i can't choose a specific fragment of code and not every piece of code has the backtick.

The issue is definitely here:

function handleKeyDown(e: KeyboardEvent) {
if (phase !== 'playing') return
if (!e.metaKey) {
e.preventDefault()
}
const expecting = codeSnippetContent[progress]
if (expecting) {
if (e.key === expecting) {
progress++
if (codeSnippetContent[progress] === '\n') {
while (/\s/.test(codeSnippetContent[progress])) {
progress++
}
}
request({ type: 'progress', progress, raceId })
}
}
}
function tryJsonParse(data: string) {
try {
return JSON.parse(data)
} catch {
return
}
}

Handling the keydown event has it's own set of problems. The best solution would be to let the user write in an input (handled by the browser) and use the input event to check for the correctness.

If you want i might try to take a shot at this and open a PR. Let me know.

[feature] Custom snippet

I would like to be able to practice touch typing with some text that I introduce, or I'd give a link to a raw github page and load that text.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.