Skip to content

Instantly share code, notes, and snippets.

View ricvillagrana's full-sized avatar
:atom:

Ricardo Villagrana ricvillagrana

:atom:
View GitHub Profile
@ricvillagrana
ricvillagrana / javascript-proxy-as-rest-client.js
Created February 8, 2022 17:26 — forked from DavidWells/javascript-proxy-as-rest-client.js
Using a javascript proxy as low code REST client
/* Using a JavaScript proxy for a super low code REST client */
// via https://dev.to/dipsaus9/javascript-lets-create-aproxy-19hg
// also see https://towardsdatascience.com/why-to-use-javascript-proxy-5cdc69d943e3
const createApi = (url) => {
return new Proxy({}, {
get(target, key) {
return async function(id = "") {
const response = await fetch(`${url}/${key}/${id}`)
if (response.ok) {
return response.json();

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@ricvillagrana
ricvillagrana / deploy-to-digital-ocean.markdown
Created March 22, 2019 21:27 — forked from montrealist/deploy-to-digital-ocean.markdown
How to deploy files to Digital Ocean when pushing to Gitlab

How to get auto-deploy working from Gitlab to your Digital Ocean (DO) server.

Install https://github.com/olipo186/Git-Auto-Deploy (via apt-get):

sudo apt-get install software-properties-common
sudo add-apt-repository ppa:olipo186/git-auto-deploy
sudo apt-get update
sudo apt-get install git-auto-deploy