$argon2id$v=19$m=512,t=256,p=1$BkE7S3HOgeXYejXg8n2GJw$FL08AAuLYqtL//JZ/1OLr62nZMTQS1QtSgc8cp0lQI8
| # These values all come from the dashboard | |
| NEXT_PUBLIC_KNOCK_PUBLIC_API_KEY=pk_test_1234567890_abcdefghijklmnop | |
| NEXT_PUBLIC_KNOCK_FEED_ID=b935c367-2347-43b1-8f28-867330a2a636 | |
| # Replace each line break with `\n` and then wrap the whole thing in JSON. JSON.parse will properly decode all of it. | |
| KNOCK_SIGNING_KEY='{"key": "-----BEGIN RSA PRIVATE KEY-----\n<The rest of the key goes here>\n-----END RSA PRIVATE KEY-----"}' |
These snippets provide a foundation for starting and stopping supervision trees at runtime using feature flags (e.g. Launch Darkly).
Some things to note when adapting these snippets:
- application.ex needs to be adapted into an existing application. The important part is that each child spec provided is compliant, and that there is a feature flag (
ld_key) specified. - As written, if a feature flag fails for some reason, it defaults to starting all children. There is room for adaptation here as needed.
- This implementation will still require a
FeatureFlagsmodule to be available that implementsis_on?/2. Adjust as needed to accomodate your own feature flag setup.
I'm assuming you're using Apollo. This can be changed
-
Install a few dependencies:
yarn add -WD @graphql-codegen/cli @graphql-codegen/typescript @graphql-codegen/typescript-operations @graphql-codegen/typescript-react-apollo @graphql-codegen/typescript-resolvers npm-run-all ts-node -
In my setup, I also threw in
npm-run-alland made some edits to my root package.json "scripts":yarn add -WD npm-run-all"dev": "npm-run-all --parallel dev:**",
"dev:rw": "rw dev",
| release: yarn rw prisma migrate deploy | |
| web: bin/start-nginx node index.js |
Note that these dockerfiles depend on:
- Having Docker installed on your machine
- Rebuilding the image every time you want to try your latest code
- Passing necessary environment variables when you
docker run - Your app includes distillery and coveralls
Make modifications as needed to meet those requirements.
Note that multi-stage builds can be used to combine the prod and test files described below, I haven't updated the gist yet to reflect that option.
| module.exports = { | |
| env: { | |
| es6: true, | |
| node: true | |
| }, | |
| plugins: ["prettier"], | |
| extends: ["plugin:prettier/recommended"], | |
| parserOptions: { | |
| sourceType: "module" | |
| }, |
Sometimes it is useful to route traffic through a different machine for testing or development. At work, we have a VPN to a remote facility that we haven't bothered to fix for routing, so the only way to access a certain machine over that VPN is via an SSH tunnel to a machine that is reachable over the VPN. Other times, I have used this technique to test internet-facing requests against sites I am developing. It is pretty easy, and if you don't use firefox regularly, you can treat Firefox as your "Proxy" browser and other browsers can use a normal configuration (Although you can also configure an entire system to use the proxy, other articles exists that discuss this potential).
- Open a terminal
| Copyright 2018 | |
| Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. | |
| THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
| # How to upload local db to meteor: | |
| # -h = host, -d = database name, -o = dump folder name | |
| mongodump -h 127.0.0.1:3002 -d meteor -o meteor | |
| # get meteor db url, username, and password | |
| meteor mongo --url myapp.meteor.com | |
| # Response will be something like this: | |
| # mongodb://client:f8f6d5aa-1213-008f-31c8-e9e059515615@production-db-a3.meteor.io:27017/myapp_meteor_com |