Giter Club home page Giter Club logo

website-content's Introduction

website-content's People

Contributors

flaviocopes avatar simmonsr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

website-content's Issues

Wrong example about package versions

post/node/package-json/index.md explains different version symbols like ^ and ~. It seems that you tried to keep things simple by only giving general rules. The examples used in explaining ^ is wrong, ^0.13.0 won’t match 0.14.0 since 13 is the leftmost non-zero digits. You can verify this by running semver -r ^0.13.0 0.13.1 0.14.0.

HttpLink causing cors errors: createHttpLink solved them

First of all, brilliant tutorial - once of the clearest and easiest to use that I have found.

I did run into one small issue, using HttpLink caused cors errors on my machine when trying to connect to GitHub.

I changed to using createHttpLink and everything seemed to work fine :)

The two changes I needed were:

Line 4: change

import { HttpLink } from 'apollo-link-http'

to

import { createHttpLink } from "apollo-link-http";

and

Line 12: change

const httpLink = new HttpLink({ uri: 'https://api.github.com/graphql' })

to

const httpLink = new createHttpLink({ uri: 'https://api.github.com/graphql' })

Maybe it was just me, but thought I'd let you know. Thanks again for a great tutorial :)

Netlify posts broken?

Right now I'm looking for the post you made about hosting your own static blog using Hugo and I can't find it. I'm pretty sure you had a good one but can't find it in my bookmarks or using the search function. If I go here: https://flaviocopes.com/netlify/ the first sentence mentions the "netlify" tutorial but the url points to the same url you're currently on. Not sure if you got rid of that post, if so, can you point me to where it is here on github? Love your content. Thanks!

Extendind string capitalization to several words

Hi there, not exactly an issue, but I found this to be the quickest way to leave you a comment on a minor improvement on your string JS capitalization (https://flaviocopes.com/how-to-uppercase-first-letter-javascript/).

Here you can capitalize a whole string with more than one word using vanilla JS, specially useful for names. You may call it namelify to differentiate it from original.

Cheers!

String.prototype.capitalize = function() {
  return this.split(" ").map(function(elem) { return elem.charAt(0).toUpperCase() + elem.slice(1)}).join(" ")
}

missing code piece: handle uploads in node

In post/how-to-node/how-to-handle-file-uploads-node/index.md, there seems to be a piece of missing code between const path .. and image.mv .. in the third code snippet.

Return await an antipattern

How to use Async and Await with Array.prototype.map() page uses return await. This is not recommended as it creates additional unnecessary promises. Eslint also gives it a warning.

I think this page may need updating.

Simple Typo Issue

image
I think, It's more accurate if you replace '-char' with '^$char' to match the example

Wrong Content About Promise

Hello.
ES6 Job Queue Section in https://flaviocopes.com/javascript-event-loop/ page is wrong about Promise.
You say about Promise - "It’s a way to execute the result of an async function as soon as possible, rather than being put at the end of the call stack."
This is absolutely false.
Promise help to us escape callback hell not run async function as soon as possible.
Please change this text.

Potential error in "How to get yesterday's date using JavaScript"

Script example in https://flaviocopes.com/how-to-get-yesterday-date-javascript/ may behave unexpectedly at midnight - there is a chance that today and yesterday will point to different dates:

const today = new Date() // 15 Oct 2019 23:59:59
const yesterday = new Date() // 16 Oct 2019 00:00:00

yesterday.setDate(yesterday.getDate() - 1)

today.toDateString() // "Tue Oct 15 2019"
yesterday.toDateString() // "Tue Oct 15 2019"

To avoid this and similar errors, construct yesterday from current date object

const today = new Date()
const yesterday = new Date(today)

In general, when working with date calculations, there should be only one point where current date/time is retrieved. Time goes by and there's no guarantee that two consequent new Date(); new Date(); will return the same time.

P.S. There's even no guarantee that they will return the same or increasing time, because system clock may be adjusted backwards in the moment between our calls. Monotonic clock is accessed from JavaScript via performance.now() in browsers and via process.hrtime() in Node.

Simple Typo Issue

image
I think, It's more accurate if you replace -char with ^$char to match the example

Error: Cannot find module './server'

The require('./server') in the server/index.js causes an exception to be thrown when running the node server/index.js command.
This part

Let's create an entry point in server/index.js:

require('ignore-styles')

require('@babel/register')({
  ignore: [/(node_modules)/],
  presets: ['@babel/preset-env', '@babel/preset-react']
})

require('./server')

Typo

Great tutorial on Javascript Regular expressions. Thanks.

Typo: "It could also contains"
Fix: "It could also contain"

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.