Skip to content

Instantly share code, notes, and snippets.

View jotapepinheiro's full-sized avatar
🏠
Working from home

João Paulo Pinheiro jotapepinheiro

🏠
Working from home
View GitHub Profile
{
"workbench.colorTheme": "Omni",
"workbench.startupEditor": "newUntitledFile",
"workbench.editor.labelFormat": "short",
"workbench.iconTheme": "material-icon-theme",
"workbench.productIconTheme": "fluent-icons",
"polacode.backgroundColor": "#6633CC",
"editor.tabSize": 2,
{
// Define o tema do VSCode
"workbench.colorTheme": "Dracula",
//"files.autoSave": "onFocusChange",
// Configura tamanho e família da fonte
"editor.fontSize": 14,
"editor.lineHeight": 24,
"editor.fontFamily": "'Fira Code', 'Operator Mono', 'Courier New', monospace",
"editor.fontLigatures": true,
// Aplica linhas verticais para lembrar de quebrar linha em códigos muito grandes
@jotapepinheiro
jotapepinheiro / nginx.conf
Created December 14, 2019 07:36 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@jotapepinheiro
jotapepinheiro / viscosity-to-openvpn.py
Last active April 3, 2019 20:20
Convert Viscosity to Open VPN
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Converts viscosity export files into an open vpn package
Usage: python viscosity-to-openvpn.py <my_file.visc> <new_name>
"""
import io
import os
import sys
import tarfile
@jotapepinheiro
jotapepinheiro / crowd.php
Created March 18, 2019 12:36 — forked from AsaAyers/crowd.php
PHP Crowd Authentication
<?php
/**
* This file demonstrates using Atlassian Crowd for Single Sign On.
*/
$crowd_app_name = 'REMOVED';
$crowd_app_password = 'REMOVED';
$crowd_url = 'http://crowd.REMOVED.com/crowd/services/SecurityServer?wsdl';
// http://pear.php.net/package/Services_Atlassian_Crowd
@jotapepinheiro
jotapepinheiro / gist:de528a6c4ab5cbf46f26a1d3ae1b1047
Created October 11, 2018 10:41 — forked from mihaiserban/gist:1f35d488405812f2bbd4b16e38e4afb5
aws s3.listObjects recursive including metadata
const aws = require('aws-sdk')
aws.config.update({
accessKeyId: process.env.aws_access_key_id,
secretAccessKey: process.env.aws_secret_access_key,
region: process.env.aws_region});
const options = {
Bucket: process.env.s3_bucket,
region: process.env.aws_region,
@jotapepinheiro
jotapepinheiro / phpstorm-vs-sublimetext-shortcuts.md
Created September 24, 2018 00:14 — forked from silasrm/phpstorm-vs-sublimetext-shortcuts.md
Teclas de atalhos do PHPStorm com funções semelhantes ao Sublime Text, e outras interessantes.

#Teclas de atalhos do PHPStorm com funções semelhantes ao Sublime Text, e outras interessantes.

Sublime Text PHPStorm Função
CMD+P CMD+Shift+O Busca por arquivos no projeto
CMD+R CMD+F12 (1) Lista os métodos da classe e outros símbolos
CMD+F CMD+F Busca no arquivo
CMD+Option+F CMD+R Busca e troca os valores no arquivo
CMD+Shift+F CMD+Shift+F Busca, busca e troca e outros em um determinado caminho com várias regras.
CMD+D (2) Option+Up (2) Seleciona palavra
xcode-select --install
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew update
brew cask install iterm2
# update iterm2 settings -> colors, keep directory open new shell, keyboard shortcuts
brew install bash # latest version of bash
# set brew bash as default shell
brew install fortune
brew install cowsay
brew install git
<?php
function soma_horas() {
$i = $s = $hour = $min = $sec = 0;
foreach (func_get_args() as $time) {
sscanf($time, '%d:%d:%d', $hour, $min, $sec);
$i += ($hour * 60) + $min + ($sec / 60);
$s += $sec;
}
@jotapepinheiro
jotapepinheiro / rocket.chat.txt
Last active December 7, 2017 04:41
Install Rocket.Chat Ubuntu 16.04
## command 1- Instalar pacotes essenciais
apt-get install curl graphicsmagick build-essential
## command 2- Adicionar packages mongodb
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv EA312927
## command 3- Adicionar repository mongodb
echo "deb http://repo.mongodb.org/apt/ubuntu "$(lsb_release -sc)"/mongodb-org/3.2 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.2.list
## command 4- Atualizar ubuntu e instalar mongodb