See how a minor change to your commit message style can make you a better programmer.
Format: <type>(<scope>): <subject>
<scope>
is optional
import asyncio | |
loop = asyncio.get_event_loop() | |
async def hello(): | |
await asyncio.sleep(3) | |
print('Hello!') | |
if __name__ == '__main__': | |
loop.run_until_complete(hello()) | |
import * as server from "./server"; | |
new server.App |
FWIW: I (@rondy) am not the creator of the content shared here, which is an excerpt from Edmond Lau's book. I simply copied and pasted it from another location and saved it as a personal note, before it gained popularity on news.ycombinator.com. Unfortunately, I cannot recall the exact origin of the original source, nor was I able to find the author's name, so I am can't provide the appropriate credits.
Not all random values are created equal - for security-related code, you need a specific kind of random value.
A summary of this article, if you don't want to read the entire thing:
Math.random()
. There are extremely few cases where Math.random()
is the right answer. Don't use it, unless you've read this entire article, and determined that it's necessary for your case.crypto.getRandomBytes
directly. While it's a CSPRNG, it's easy to bias the result when 'transforming' it, such that the output becomes more predictable.uuid
, specifically the uuid.v4()
method. Avoid node-uuid
- it's not the same package, and doesn't produce reliably secure random values.random-number-csprng
.You should seriously consider reading the entire article, though - it's
#BrazilJS Slides 2016#
##Jake Archibald##
Keynote - Instant Loading Offline-First Progressive Web Apps The Next Generation Part Ii Uncovered
[Slides Part I] (https://speakerdeck.com/jaffathecake/offline-first-progressive-web-apps)
[Slides Part II] (https://speakerdeck.com/jaffathecake/offline-first-progressive-web-apps-part-ii-the-next-generation-uncovered)
Putting cryptographic primitives together is a lot like putting a jigsaw puzzle together, where all the pieces are cut exactly the same way, but there is only one correct solution. Thankfully, there are some projects out there that are working hard to make sure developers are getting it right.
The following advice comes from years of research from leading security researchers, developers, and cryptographers. This Gist was [forked from Thomas Ptacek's Gist][1] to be more readable. Additions have been added from
import { mountWithIntl } from 'helpers/intl-enzyme-test-helper.js'; | |
const wrapper = mountWithIntl( | |
<CustomComponent /> | |
); | |
expect(wrapper.state('foo')).to.equal('bar'); // OK | |
expect(wrapper.text()).to.equal('Hello World!'); // OK |
# make sure awscli is installed | |
pip install awscli | |
# build | |
grunt build-staging | |
# Clear staging path on s3 | |
aws s3 rm s3://[BUCKET NAME]/[DIRECTORY] --recursive | |
# Sync the dist folder | |
aws s3 sync ./dist s3://[BUCKET NAME]/[DIRECTORY] --acl public-read --cache-control "public, max-age=86400" | |
# Update index.html to have a 60sec cache | |
aws s3api copy-object --copy-source [BUCKET NAME]/[FILEPATH] --cache-control "public, max-age=60" --content-type "text/html" --bucket [BUCKET NAME] --key [FILEPATH] --metadata-directive="REPLACE" |