Skip to content

Instantly share code, notes, and snippets.

View AllanJeremy's full-sized avatar
🎧
Wired in

Allan N Jeremy AllanJeremy

🎧
Wired in
View GitHub Profile
@AllanJeremy
AllanJeremy / api.js
Last active November 8, 2020 15:44
A simple API response helper. Formats API responses in a consistent manner. Concepts and format borrowed from the telegram API.
/** Get an API response
* @param {String} message Message to return as part of the response
* @param {Object} data An object representing data returned as part of the API response. Default: `null`
* @param {Number} statusCode HTTP status code to be returned with this response. Default: `200`
* @return {Object} An API response object
*/
const getResponse = (ok, message, data = null, statusCode = 200) => {
let response = {
ok,
message,
@joseluisq
joseluisq / Debugging.md
Last active September 3, 2023 16:54
A simple NodeJS App debugging example in VS Code using Nodemon.

NodeJS debugging in VS Code with Nodemon

A simple NodeJS App debugging example in VS Code using Nodemon.

Note: Feel free to customize .vscode/launch.json and ./nodemon.json files.

Install

yarn add nodemon --dev
@mandiwise
mandiwise / Update remote repo
Last active August 20, 2024 17:36
Transfer repo from Bitbucket to Github
// Reference: http://www.blackdogfoundry.com/blog/moving-repository-from-bitbucket-to-github/
// See also: http://www.paulund.co.uk/change-url-of-git-repository
$ cd $HOME/Code/repo-directory
$ git remote rename origin bitbucket
$ git remote add origin https://github.com/mandiwise/awesome-new-repo.git
$ git push origin master
$ git remote rm bitbucket