Skip to content

Instantly share code, notes, and snippets.

View lflucasferreira's full-sized avatar
🎈
Don't you want it?

Lucas Ferreira lflucasferreira

🎈
Don't you want it?
View GitHub Profile
/*
Number 1 : use '===' over '=='
*/
true == 'true' // bad
true === 'true' // good
/*
Number 2 : use 'let' over 'var'
*/
var dog = 'Dexter' // bad

Postman Ubuntu

The new postman native app for linux is great! On Ubuntu though, it doesn't create any symbolic links to your app — I link to launch all my apps via Synapse, the simple but powerful application launcher. Follow these short steps to launch your Postman instance via Synapse/any other application launcher:

  • Copy the app directory to a folder of your choice
  • Download the image from here and place it in the same folder.
  • Create a *.desktop file in /home/username/.local/share/applications/postman.desktop
  • Copy paste the contents:
@lflucasferreira
lflucasferreira / countries.json
Created February 10, 2021 18:05 — forked from erdem/countries.json
Country list as JSON format. fields: name, coordinates, timezones, country code and capital resource: https://github.com/mledoze/countries
[
{
"timezones": [
"America/Aruba"
],
"latlng": [
12.5,
-69.96666666
],
"name": "Aruba",
@lflucasferreira
lflucasferreira / pre-request.js
Last active July 1, 2022 16:06
How to Automate OAuth2 Token Renewal in Postman
// ###########################################################################
// Define required packages
// ###########################################################################
let moment = require("moment"); // Used to create/format date
// ###########################################################################
// Define variables
// ###########################################################################

Redirecting HTTP to HTTPS

Redirect All Web Traffic

If you have existing code in your .htaccess, add the following:

RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.yourdomain.com/$1 [R,L]

apk

apk-tools 2.8.2, compiled for x86_64.

usage: apk COMMAND [-h|--help] [-p|--root DIR] [-X|--repository REPO] [-q|--quiet] [-v|--verbose] [-i|--interactive] [-V|--version] [-f|--force]
           [--force-binary-stdout] [--force-broken-world] [--force-non-repository] [--force-old-apk] [--force-overwrite] [--force-refresh] [-U|--update-cache]
           [--progress] [--progress-fd FD] [--no-progress] [--purge] [--allow-untrusted] [--wait TIME] [--keys-dir KEYSDIR] [--repositories-file REPOFILE]
           [--no-network] [--no-cache] [--cache-dir CACHEDIR] [--arch ARCH] [--print-arch] [ARGS]...
@lflucasferreira
lflucasferreira / github_secrets.md
Created July 13, 2020 21:36 — forked from shime/github_secrets.md
Secret Github Features

Taken from Zach Holman's "Git and Github Secrets".

Keyboard Shortcuts

t - quickly jump through files (similar to cmd+T in VI or Text Mate)

w - quickly switch branches

s - search

@lflucasferreira
lflucasferreira / docker host
Last active April 26, 2021 17:38
Docker Exec Xargs
export DOCKER_HOST=127.0.0.1
Host <name>
HostName <IP or URL>
User <user>
Port <port = 22>
IdentityFile <path to ssh private key = C:/Users/suporte/.ssh/id_rsa-remote-ssh>
RemoteCommand <command to execute after login = cd /home/administrator/qa && bash>
RequestTTY force
[alias]
ci = commit
co = checkout
cm = checkout master
cb = checkout -b
st = status -sb
sf = show --name-only
lg = log --pretty=format:'%Cred%h%Creset %C(bold)%cr%Creset %Cgreen<%an>%Creset %s' --max-count=30
incoming = !(git fetch --quiet && git log --pretty=format:'%C(yellow)%h %C(white)- %C(red)%an %C(white)- %C(cyan)%d%Creset %s %C(white)- %ar%Creset' ..@{u})
outgoing = !(git fetch --quiet && git log --pretty=format:'%C(yellow)%h %C(white)- %C(red)%an %C(white)- %C(cyan)%d%Creset %s %C(white)- %ar%Creset' @{u}..)