Skip to content

Instantly share code, notes, and snippets.

View zazk's full-sized avatar
:octocat:
Let's talk about Javascript & DevOps

Enrique Juan de Dios zazk

:octocat:
Let's talk about Javascript & DevOps
View GitHub Profile
@zazk
zazk / deploy.nodejs.api.netlify.md
Created February 25, 2025 21:43
Deploy API to Netlify

Deploying a Node.js/Express application to Netlify requires some adjustments because Netlify is primarily designed for static sites and serverless functions. However, you can deploy your Node.js/Express app to Netlify using Netlify Functions or by combining it with a service like Heroku or Render for backend hosting. Below, I'll guide you through deploying your app using Netlify Functions.


Steps to Deploy to Netlify

1. Refactor Your App for Netlify Functions

Netlify Functions allow you to run server-side code as serverless functions. You’ll need to refactor your Express app into a function.

Update your index.js to work as a Netlify Function:

@zazk
zazk / useEditor.tsx
Created August 13, 2024 14:11
useEditor.tsx Trix
import { useEffect, useRef } from 'react';
import { UseFormReturn } from 'react-hook-form';
interface UseEditorProps {
form: UseFormReturn<any>; // Replace `any` with your specific form type if possible
noteContent: string;
inputRef: React.RefObject<HTMLInputElement>;
}
export const useEditor = ({ form, noteContent, inputRef }: UseEditorProps) => {
@zazk
zazk / sql
Created April 2, 2024 17:06 — forked from alexander-ae/sql
wordpress - replace url
UPDATE wp_options SET option_value = replace(option_value, 'http://www.oldurl', 'http://www.newurl') WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE wp_posts SET guid = replace(guid, 'http://www.oldurl','http://www.newurl');
UPDATE wp_posts SET post_content = replace(post_content, 'http://www.oldurl', 'http://www.newurl');
UPDATE wp_postmeta SET meta_value = replace(meta_value,'http://www.oldurl','http://www.newurl');
@zazk
zazk / postgres-brew.md
Created October 26, 2022 00:56 — forked from ibraheem4/postgres-brew.md
Installing Postgres via Brew (OSX)

Installing Postgres via Brew

Pre-Reqs

Brew Package Manager

In your command-line run the following commands:

  1. brew doctor
  2. brew update
@zazk
zazk / DEPLOYMENT.md
Last active May 25, 2020 01:24
GitHub Actions NodejS

Deploy to Digital Ocean Droplet

This guide use https://github.com/appleboy/ssh-action to deploy this repository, you can modify the commands as you want.

In the Github Repository

  1. Create a /.github/workflows/deployment.yml
  2. Setup in Github Secrets:
  • SERVER_IP: Server IP Address
  • SERVER_USERNAME: Username
  • SERVER_PASSWORD: Password
  • PROJECT_PATH: Project path
@zazk
zazk / storytelling-resources.md
Last active April 27, 2020 19:39
Storytelling Resources

https://rockcontent.com/es/blog/que-es-storytelling/

  • Scott McCloud:
  • Understanding Comics
  • Reinventing Comics
  • Making Comics
  • The Hero's Journey (Joseph Campbell)
  • The Hero of a Thousand Faces (Joseph Campbell)
  • Save the Cat (Blake Snyder)
  • The Storytelling Animal
  • The Moth
@zazk
zazk / questionsInWP.js
Last active March 30, 2020 19:27 — forked from nelsson/questionsInWP.js
in process
$ = jQuery.noConflict();
function menuRespuesta(id){
var htmlTextArea = `<div class="c-wrap-menu b1">
<span class="c-open-menu">
<span class="fa fa-caret-down"></span>
</span>
<div class="c-menu-desplegable">
<h3 class="c-menu-title">Tipo de respuesta</h3>
<ul class="c-menu-list">
@zazk
zazk / protoc-gen-go.sh
Created March 24, 2020 18:02 — forked from f3nry/protoc-gen-go.sh
Generating proto Go code from a definition
brew install protobuf
go get -u google.golang.org/grpc
go get -u github.com/golang/protobuf/protoc-gen-go
protoc -I=./api --go_out=plugins=grpc:./api ./api/hello.proto
@zazk
zazk / README.md
Last active August 6, 2020 11:47
Mac OS Developer Setup