In order to automate semantic versioning, GitHub releases and NPM package publishing we can leverage Github Actions alongside Changesets Release Action.
For this guide, I'll be following the steps I used in my require-ts-check ESLint Pluggin repo.
In order to automate semantic versioning, GitHub releases and NPM package publishing we can leverage Github Actions alongside Changesets Release Action.
For this guide, I'll be following the steps I used in my require-ts-check ESLint Pluggin repo.
| node_modules/ | |
| README.md |
Running a script in the background in linux can be done using nohup, using nohup we can run node application in the background
$ nohup node server.js > /dev/null 2>&1 &nohup means: Do not terminate this process even when the stty is cut off> /dev/null means: stdout goes to /dev/null (which is a dummy device that does not record any output)| import * as Sentry from '@sentry/browser'; | |
| import getConfig from 'next/config'; | |
| import React from 'react'; | |
| const { SENTRY_DSN } = getConfig().publicRuntimeConfig; | |
| Sentry.init({ dsn: SENTRY_DSN }); | |
| /** | |
| * Send an error event to Sentry. |
| 'use strict'; | |
| const AmqpClient = require('amqplib'); | |
| const Promise = require('bluebird'); | |
| const contentTypeJson = 'application/json'; | |
| const contentEncoding = 'utf8'; | |
| const config = { | |
| exchanges: [ | |
| { name: 'A_COMMENT_CREATED', type: 'fanout' }, | |
| { name: 'A_COMMENT_DELETED', type: 'fanout' }, |
| // There are many complicated solutions out there. | |
| // In fact, it's pretty easy to autoscale an image if you know the original dimensions. | |
| // Otherwise, see Image.getSize. It should be easy to create a custom component that | |
| // leverages Image.getSize to use this technique | |
| // | |
| import React, { Component } from 'react'; | |
| import { StyleSheet, Image, View } from 'react-native'; | |
| … // inside render() | |
| <View style={styles.responsiveContainer}> |
First of all, please note that token expiration and revoking are two different things.
A JWT token that never expires is dangerous if the token is stolen then someone can always access the user's data.
Quoted from JWT RFC:
| /** | |
| * Example to refresh tokens using https://github.com/auth0/node-jsonwebtoken | |
| * It was requested to be introduced at as part of the jsonwebtoken library, | |
| * since we feel it does not add too much value but it will add code to mantain | |
| * we won't include it. | |
| * | |
| * I create this gist just to help those who want to auto-refresh JWTs. | |
| */ | |
| const jwt = require('jsonwebtoken'); |
| /* | |
| * Migration | |
| */ | |
| 'use strict'; | |
| module.exports = { | |
| up: function(queryInterface, Sequelize) { | |
| return queryInterface.createTable('Users', { | |
| firstName: { | |
| type: Sequelize.STRING | |
| }, |
| /** | |
| * RxJava2 and Retrofit 2.2.0 compatible factory, | |
| * which wraps the {@link RxJava2CallAdapterFactory} and takes care of the error conversion. | |
| * | |
| * Based on: https://github.com/square/retrofit/issues/1102#issuecomment-241250796 | |
| */ | |
| public class RxErrorHandlingCallAdapterFactory extends CallAdapter.Factory { | |
| private final RxJava2CallAdapterFactory mOriginalCallAdapterFactory; | |
| private RxErrorHandlingCallAdapterFactory() { |