website-content's Introduction
website-content's People
Forkers
draegog cibervicho alex-ngv nandihno sam1997 sahajre rational-discussion mmoga jeetendra-choudhary yuhanasy cotheta laradevio carlosvin vishnumanjunath julpat kaveet sofiapag edgar256 azarual nagasain brunowinck nazir-hasan apuff zibri danielbenedykt sotek222 mansouroopi patni1992 faheemulhasan gfore subfighter3 shufean muisoft ryan-cal banibrata-21219 developerpnal shrek95 sk8guerra nirobnabil josephitopa makkianjum thesyedkazmi rhieger sammychinedu2ky barcajames michermd jjrosalesuci mikeadams1 felixturner theon9sclub liormesser dannielb kirankumarambati mrassili miguelangeltorresfp oshihirii patrickwerz gaylonalfano umarishfaq037 santhoshbalagur jtackkett rharkanson rrakso td-banderson wachukxs qrzysio sundevyl rakeshkumar001 metinaktug chafikgharbi bsewell tayfunerbilen tenly2000 jassehomar agsiegert rhingstrumjr kodegenius anurella alekbless punp94 chuksjoe fcastillo18 rohitms ideabrian metiara mikesh-pccw mo-saf avxkim cristianprice ujeshurun wesleyfongchong rafaelcastrocouto hawz osparksolutions nodirsid deefem phillr-dm hamiduabu muniftanjim dotnetspecwebsite-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!
Why not iterate over an object properties with for..in?
Incorrect advice for solving issues with global npm install
This article gives incorrect and potentially dangerous advice about how to solve npm global installation errors. The more correct way to deal with the permission errors is to create a user-owned directory for global modules, as detailed in the npm docs.
Node.js streams
Hi @flaviocopes, you cannot create a Readable
without implementing a read
or _read
method
Subscribe form missing on ebooks page
Just fyi:
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(" ")
}
idea: add example of async await within map, in series
re: https://flaviocopes.com/javascript-async-await-array-map.
maybe something like this:
const wait = time => {
return new Promise(resolve => setTimeout(resolve, time))
}
const someFn = async (item) => {
await wait(2000)
console.log(item)
}
// in series
const example = async () => {
for (const item of ['first', 'second', 'third']) {
await someFn(item)
}
}
example();
// 0s
// 2s - 'first'
// 4s - 'second'
// 6s - 'third'
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.
Promise map example doesn't work.
The example here does not provide the desired result: https://github.com/flaviocopes/website-content/blob/content/post/javascript/javascript-async-await-array-map/index.md
The resulting log is a promise object - because async functions don't return the resolved value.
Here is a stackblitz that runs your code from this page: https://stackblitz.com/edit/typescript-tky1fv
Notice the log which is just a Promise object.
website-content/post/express/express-validate-input/index.md
After running the code an error pops up saying 'express-validator/check' is deprecated so use express-validator instead.
Can you update the page?
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.
Incorrect information about npm install
You need to pass --save or --save-dev to npm install in order for the package.json and package-lock.json to be updated.
Small mistake in file
On the file:
https://github.com/flaviocopes/website-content/blob/content/post/javascript/javascript-global-object/index.md
on line 241 it says
// "http%3A%2F%2Fflaviocopes.com%2F%20hey!%2F"
where it should say
// "http%3A%2F%2Fwww.example.org%2Fa%20file%20with%20spaces.html"
Simple Typo Issue
No longer see dark/light icon + other elements
I can no longer see the moon dark/light icon. I can't pinpoint what but other website elements seem to be missing as well.
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.
Not An Issue
Incorrect
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
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"
Incorrect use of [].splice in 2 blog posts
Hey,
while looking for a good way of diving an array into pieces, I found your 2 blog posts
- https://flaviocopes.com/how-to-cut-array-half-javascript/
- https://flaviocopes.com/how-to-divide-array-js/
In those 2 posts you use the Array splice
method, but I think you meant slice
(without "p"). 😉
PS: I found no other way of contacting you about this (except twitter, which I don't have an account for) ^^
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.