- Update
package.json
, setversion
to a prerelease version, e.g.2.0.0-rc1
,3.1.5-rc4
, ... - Run
npm pack
to create package - Run
npm publish <package>.tgz --tag next
to publish the package under thenext
tag - Run
npm install --save package@next
to install prerelease package
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// If the user has been on the page for over 12 hours, the next link | |
// click will do a full page transition to get new code | |
import React from "react"; | |
import { BrowserRouter, useLocation } from "react-router-dom"; | |
let hour = 3600000; | |
export default function StaleAppRouter(props) { | |
let [isStale, setIsStale] = useState(false); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { NextApiResponse, NextApiRequest } from "next"; | |
const twillio = require('twilio'); | |
const authToken = process.env.TWILIO_AUTH_TOKEN; | |
const accountSid = process.env.TWILIO_ACCOUNT_SID; | |
const myCellPhoneNumber = process.env.MY_NUMBER; | |
const superSecretAPIKey = 'ABCD1234'; | |
export default async (req: NextApiRequest, res: NextApiResponse) => { | |
const client = twillio(accountSid, authToken); | |
const auth = req.headers.authorization; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Timer() { | |
const startTime = React.useRef(performance.now()); | |
const [time, setTime] = React.useState(performance.now()); | |
React.useEffect(() => { | |
const id = setTimeout(() => { | |
ReactDOM.flushSync(() => { | |
setTime(performance.now()); | |
}); | |
}, 2); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Usage: git md | |
# Goes in your bin folder, mine is /usr/bin/ | |
BRANCH_NAME=$(git rev-parse --abbrev-ref HEAD) | |
git checkout origin/develop | |
git pull origin develop | |
npm run pull-apps | |
git checkout $BRANCH_NAME | |
git merge origin/develop |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* A utility for reading nested objects without pulling your hair out. | |
* | |
* Supported objects: List, Map, JSONObject, JSONArray | |
* | |
*/ | |
public class ObjectReader implements Iterable<ObjectReader> { | |
private final Object map; | |
/** |
To remove a submodule you need to:
- Delete the relevant section from the .gitmodules file.
- Stage the .gitmodules changes git add .gitmodules
- Delete the relevant section from .git/config.
- Run git rm --cached path_to_submodule (no trailing slash).
- Run rm -rf .git/modules/path_to_submodule (no trailing slash).
- Commit git commit -m "Removed submodule "
- Delete the now untracked submodule files rm -rf path_to_submodule
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://developer.mozilla.org/en-US/docs/Web/API/window.setTimeout | |
var timeoutID; | |
delayedAlert(); | |
function delayedAlert() { | |
timeoutID = window.setTimeout(slowAlert, 2000); | |
} | |
function slowAlert() { |
https://devcenter.heroku.com/articles/custom-domains http://thenomadicfreelancer.blogspot.com/2012/08/pointing-godaddy-domain-to-your-heroku.html
For each custom subdomain use domains:add
in the Terminal.
NewerOlder