Skip to content

Instantly share code, notes, and snippets.

View mirlisboa's full-sized avatar

Mirela Lisboa Sobreira mirlisboa

View GitHub Profile
@mirlisboa
mirlisboa / postman-api-testing.md
Created February 10, 2023 13:21 — forked from zec4o/postman-api-testing.md
Testes Automatizados de API com Postman
# Step 1
# create main branch locally, taking the history from master
git branch -m master main
# Step 2
# push the new local main branch to the remote repo (GitHub)
git push -u origin main
# Step 3
# switch the current HEAD to the main branch
@mirlisboa
mirlisboa / git_ssl_self_signed.md
Created June 10, 2021 16:57 — forked from peschee/git_ssl_self_signed.md
Disable SSL verification in git repositories with self-signed certificates

Sometimes, we have to access git repositories over SSL and the server only provides a self-signed certificate 🙈. Although there are ways to increase the trust level for the self-signed certificate (https://confluence.atlassian.com/fishkb/unable-to-clone-git-repository-due-to-self-signed-certificate-376838977.html, https://confluence.atlassian.com/bitbucketserverkb/resolving-ssl-self-signed-certificate-errors-806029899.html), my recommendation is to just ignore SSL verification alltogether.

Prepend GIT_SSL_NO_VERIFY=true before every git command run to skip SSL verification. This is particularly useful if you haven't checked out the repository yet.

Run git config http.sslVerify false to disable SSL verification if you're working with a checked out repository already.

@mirlisboa
mirlisboa / docker-build-private-github.md
Created June 10, 2021 15:05 — forked from zoellner/docker-build-private-github.md
Extract Github token for Docker build with private repo

Note: There are better ways to do this by now. Check https://docs.docker.com/develop/develop-images/build_enhancements/#new-docker-build-secret-information for details

In order to access packages in private github repositories a Dockerfile might contain statements like this:

RUN git config --global url."https://${GITHUB_TOKEN}@github.com/".insteadOf "https://github.com/"
RUN npm install --ignore-scripts --quiet && npm cache clean --force
RUN git config --global --unset url."https://${GITHUB_TOKEN}@github.com/".insteadOf
@mirlisboa
mirlisboa / Response.php
Created June 5, 2021 17:42 — forked from jeffochoa/Response.php
Laravel HTTP status code
<?php
// This can be found in the Symfony\Component\HttpFoundation\Response class
const HTTP_CONTINUE = 100;
const HTTP_SWITCHING_PROTOCOLS = 101;
const HTTP_PROCESSING = 102; // RFC2518
const HTTP_OK = 200;
const HTTP_CREATED = 201;
const HTTP_ACCEPTED = 202;
@mirlisboa
mirlisboa / App\Http\Resources\EventResource.php
Created June 3, 2021 01:50 — forked from harrysbaraini/App\Http\Resources\EventResource.php
Laravel API Resources with permissions and links
<?php
namespace App\Http\Resources;
use App\Http\Handlers\Admin\UploadMediaFile;
use App\Http\Resources\Support\ResourceLink;
use App\Policies\EventPolicy;
use Illuminate\Support\Facades\Auth;
class EventResource extends ItemResource
@mirlisboa
mirlisboa / Rails DockerFile
Created February 7, 2021 23:46 — forked from colby-swandale/Rails DockerFile
Dockerfile with rbenv and ruby-install
FROM ubuntu:latest
MAINTAINER Colby Swandale <colby@taplaboratories.com.au>
# update apt cache and install dependencies
RUN apt-get update && apt-get install git curl build-essential libssl-dev libreadline-dev zlib1g-dev sqlite3 libsqlite3-dev -y
# add app user
RUN adduser --gecos '' --disabled-password app
# set user to app
USER app
# set rbenv, ruby-build bin paths
ENV HOME /home/app
@mirlisboa
mirlisboa / ca.md
Created February 26, 2020 18:09 — forked from KennedyTedesco/ca.md
How to setup your own CA with OpenSSL

How to setup your own CA with OpenSSL

For educational reasons I've decided to create my own CA. Here is what I learned.

First things first

Lets get some context first.

@mirlisboa
mirlisboa / sublime-text-3-windows-shortcuts.md
Created August 23, 2019 02:00 — forked from mrliptontea/sublime-text-3-windows-shortcuts.md
Sublime Text 3 - Useful Shortcuts (Windows)

Sublime Text 3 - Useful Shortcuts (Windows)

General

Shortcut Description
Ctrl+Shift+P command prompt
Ctrl+Alt+P switch project
Ctrl+P go to file
Ctrl+G go to line
@mirlisboa
mirlisboa / gnome-terminal-profiles.adoc
Last active July 7, 2019 05:42
Export / Import Gnome Terminal Profiles

Export Gnome Terminal Profile

List profiles

dconf dump /org/gnome/terminal/legacy/profiles:/

Determine the terminal profile string for the profile you will need. This is the terminal profile that I will export: