- API key for OpenAI.
- API key for Picovoice
- API key for ElevenLabs
- mpg123 installed
- node 18+
git clone https://gist.github.com/ericlewis/ccd3f0b7a17fcbe2473121a473082c8f- edit .env with your keys
Made this example to show how to use Next.js router for a 100% SPA (no JS server) app.
You use Next.js router like normally, but don't define getStaticProps and such. Instead you do client-only fetching with swr, react-query, or similar methods.
You can generate HTML fallback for the page if there's something meaningful to show before you "know" the params. (Remember, HTML is static, so it can't respond to dynamic query. But it can be different per route.)
Don't like Next? Here's how to do the same in Gatsby.
This focuses on generating the certificates for loading local virtual hosts hosted on your computer, for development only.
Do not use self-signed certificates in production ! For online certificates, use Let's Encrypt instead (tutorial).
| $( document ).ready(function() { | |
| /** | |
| * Cookies management library | |
| * | |
| * @type type | |
| */ | |
| var helperCookie = { | |
| findAll: function () { | |
| var cookies = {}; |
| #!/bin/bash | |
| # REPO_NAME=<repo>.git | |
| # ORIGIN_URL=git@<host>:<project>/$REPO_NAME | |
| # REPO1_URL=git@<host>:<project>/$REPO_NAME | |
| rm -rf $REPO_NAME | |
| git clone --bare $ORIGIN_URL | |
| if [ "$?" != "0" ]; then | |
| echo "ERROR: failed clone of $ORIGIN_URL" |
This is the follow up to a post I wrote recently called From Require.js to Webpack - Party 1 (the why) which was published in my personal blog.
In that post I talked about 3 main reasons for moving from require.js to webpack:
Here I'll instead talk about some of the technical challenges that we faced during the migration. Despite the clear benefits in developer experience (DX) the setup was fairly difficult and I'd like to cover some of the challanges we faced to make the transition a bit easier.
| title | slug | createdAt | language | preview |
|---|---|---|---|---|
Unit testing Angular.js app with node.js, mocha, angular-mocks and jsdom |
unit-testing-angular-js-app-with-node |
2015-07-05T18:04:33Z |
en |
Majority of search result about unit testing Angular.js apps is about how to do it by using test frameworks that run the tests in a real browser. Even though it's great to be able to test your code in multiple platforms, in my opinion it creates a lot of boilerplate code and makes it hard to run the tests in, for instance a CI-server. |
Lean unit tests with minimal setup
| . | |
| ├── actions | |
| ├── stores | |
| ├── views | |
| │ ├── Anonymous | |
| │ │ ├── __tests__ | |
| │ │ ├── views | |
| │ │ │ ├── Home | |
| │ │ │ │ ├── __tests__ | |
| │ │ │ │ └── Handler.js |