Skip to content

Instantly share code, notes, and snippets.

View mplibunao's full-sized avatar

Mark Paolo Libunao mplibunao

View GitHub Profile
@mplibunao
mplibunao / mpremotebashrc.sh
Last active September 13, 2021 03:31
my .bashrc for sshing to remote servers
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac

How to add APIs and Scopes to a Google Cloud Project

  • From the dashboard page of your project, click Enable APIs and Services

Screenshot from 2021-06-25 10-48-07

  • It should redirect you to the API Library page

Screenshot from 2021-06-25 10-49-36

@mplibunao
mplibunao / react notes.md
Last active February 27, 2019 06:21
React Notes
@mplibunao
mplibunao / product.test.js
Created January 28, 2019 15:05
Create Product Test
/**
Async/await and .then(data) are similar
The only difference is async/await looks cleaner without the nested shit
**/
// Async version
// References:
// https://devhints.io/es6
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function
@mplibunao
mplibunao / product.controller.js
Created January 28, 2019 14:40
Sample Create New Product
const Product = require('../models/product.model.js');
exports.create = (req, res) => {
// Validation
if (!req.body.name) {
return res.status(400).send({
message: "Product name cannot be empty"
});
}
if (!req.body.categoryId) {