Skip to content

Instantly share code, notes, and snippets.

View yurireeis's full-sized avatar
🎯
Focusing

Yuri Reis yurireeis

🎯
Focusing
View GitHub Profile
@yurireeis
yurireeis / How to create Node cli executable from npm.md
Created May 27, 2024 21:33 — forked from mritzco/How to create Node cli executable from npm.md
Create Node Package (cli) executable from npm scripts

Creating an executable NPM package and using it

This short guide explains how to create an NPM package that can be called as a script from another project. For clarity: The package to execute will be called: Module The place where you use it: Application

1. Build your module

Create a standard module ignore command line parsing

@yurireeis
yurireeis / letsencrypt_2020.md
Created June 23, 2021 00:06 — forked from cecilemuller/letsencrypt_2020.md
How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SSL rating)

How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SLL rating)


Virtual hosts

Let's say you want to host domains first.com and second.com.

Create folders for their files:

@yurireeis
yurireeis / 2019-https-localhost.md
Created June 23, 2021 00:05 — forked from cecilemuller/2019-https-localhost.md
How to create an HTTPS certificate for localhost domains

How to create an HTTPS certificate for localhost domains

This focuses on generating the certificates for loading local virtual hosts hosted on your computer, for development only.

Do not use self-signed certificates in production ! For online certificates, use Let's Encrypt instead (tutorial).

@yurireeis
yurireeis / Startup.cs
Created August 3, 2020 15:49
CORS allow any with C# and .NET Core 2.2
namespace YourProjectNamespace
{
public class Startup
{
public Startup(IConfiguration configuration) => Configuration = configuration;
public IConfiguration Configuration { get; }
public void ConfigureServices(IServiceCollection services)
{
@yurireeis
yurireeis / config.xml
Last active July 24, 2019 14:04
CircleCI config file using Git Flow and Publishing to Google Play (Alpha Trail)
default: &default
working_directory: /home/circleci/project
docker:
- image: circleci/node:8-stretch-browsers-legacy
android: &android
working_directory: /home/circleci/project
docker:
- image: beevelop/ionic:latest
@yurireeis
yurireeis / Dockerfile
Created July 24, 2019 13:49
Jenkins docker inside docker (dind)
FROM jenkins/jenkins:lts
LABEL maintainer="[email protected]"
USER root
ENV JENKINS_HOME=/var/jenkins_home
WORKDIR ${JENKINS_HOME}
@yurireeis
yurireeis / Jenkinsfile
Last active July 24, 2019 13:50
Jenkinsfile (declarative pipeline) with Git Flow method based on commit messages and branch names and notifications on each step (Bitbucket example)
def isMajor(message) {
if (message?.trim()) {
message = message.toLowerCase()
return message.startsWith("breakchange")
}
return false
}
def isMinor(message) {
export enum HTTP_STATUS {
CONTINUE = 100,
SWITCHING_PROTOCOLS = 101,
PROCESSING = 102,
OK = 200,
CREATED = 201,
ACCEPTED = 202,
NON_AUTHORITATIVE_INFORMATION = 203,
NO_CONTENT = 204,
RESET_CONTENT = 205,
@yurireeis
yurireeis / PULL_REQUEST.txt
Last active October 24, 2018 12:35
a simple clarification about How nine states of design and Microcopy rules can be applied in a pull request
## About Pull Request
### What We Have done?
Related to company/issues#
### What We have to test?
- [ ]
- [ ]
@yurireeis
yurireeis / git_win10.ps1
Last active October 2, 2018 01:46
vscode and git install (ubuntu and win)
# setup with powershell
$client = new-object System.Net.WebClient
$client.DownloadFile("https://github.com/git-for-windows/git/releases/download/v2.19.0.windows.1/Git-2.19.0-64-bit.exe","git.exe")
# install
$pathvargs = {c:\Users\Aluno\git.exe }
Invoke-Command -ScriptBlock $pathvargs