Skip to content

Instantly share code, notes, and snippets.

View carlosocarvalho's full-sized avatar
🎯
Focusing

Carlos Carvalho carlosocarvalho

🎯
Focusing
View GitHub Profile
@carlosocarvalho
carlosocarvalho / javascript-object-to-querystring.js
Created March 1, 2019 01:33 — forked from tjmehta/javascript-object-to-querystring.js
Object to Querystring - JavaScript, JS, JSON
function objectToQuerystring (obj) {
return Object.keys.reduce(function (str, key, i) {
var delimiter, val;
delimiter = (i === 0) ? '?' : '&';
key = encodeURIComponent(key);
val = encodeURIComponent(obj[key]);
return [str, delimiter, key, '=', val].join('');
}, '');
}
@carlosocarvalho
carlosocarvalho / Jenkinsfile
Created February 16, 2019 01:53 — forked from bvis/Jenkinsfile
Jenkin pipeline definition example to be integrated with Docker Swarm cluster in our CI/CD environment
pipeline {
agent { node { label 'swarm-ci' } }
environment {
TEST_PREFIX = "test-IMAGE"
TEST_IMAGE = "${env.TEST_PREFIX}:${env.BUILD_NUMBER}"
TEST_CONTAINER = "${env.TEST_PREFIX}-${env.BUILD_NUMBER}"
REGISTRY_ADDRESS = "my.registry.address.com"
SLACK_CHANNEL = "#deployment-notifications"
@carlosocarvalho
carlosocarvalho / nginx.conf
Created September 17, 2018 16:05 — forked from calebwoods/nginx.conf
Sample Nginx config for deployment of Angular.js app
server { listen 80;
server_name example.com;
access_log /var/log/example.com/nginx.access.log;
error_log /var/log/example.com/nginx.error.log;
root /var/www/apps/example.com/public;
charset utf-8;
location / {
rewrite ^ https://$host$request_uri? permanent;
}
@carlosocarvalho
carlosocarvalho / postman_install.sh
Created August 16, 2018 22:22 — forked from posemon/postman_install.sh
Postman install Ubuntu 18.04
#!/bin/bash
# Get postman app
wget https://dl.pstmn.io/download/latest/linux64 -O postman.tar.gz
sudo tar -xzf postman.tar.gz -C /opt
sudo ln -s /opt/Postman/Postman /usr/bin/postman
#Create a Desktop Entry
cat > ~/.local/share/applications/postman.desktop <<EOL
[Desktop Entry]
Encoding=UTF-8
@carlosocarvalho
carlosocarvalho / openssl_encrypt_decrypt.php
Created August 2, 2018 16:04 — forked from joashp/openssl_encrypt_decrypt.php
Simple PHP encrypt and decrypt using OpenSSL
<?php
/**
* simple method to encrypt or decrypt a plain text string
* initialization vector(IV) has to be the same when encrypting and decrypting
*
* @param string $action: can be 'encrypt' or 'decrypt'
* @param string $string: string to encrypt or decrypt
*
* @return string
*/
/**
* Class to check up e-mail
*
* @author Konstantin Granin <kostya@granin.me>
* @copyright Copyright (c) 2010, Konstantin Granin
*/
class VerifyEmail {
/**
@carlosocarvalho
carlosocarvalho / jwt.interceptor.ts
Created January 6, 2018 00:56 — forked from filipemansano/jwt.interceptor.ts
Interceptador HTTP em Angular 5 para adicionar o Token JWT nos request, e renovar o token caso expirado funcionando com múltiplas chamadas
import { Injectable, Injector } from '@angular/core';
import {
HttpInterceptor,
HttpRequest,
HttpHandler,
HttpEvent
} from '@angular/common/http';
@carlosocarvalho
carlosocarvalho / dev.php.jr.md
Last active July 26, 2017 03:18
Desenvolvedor Back-end PHP - Junior

Desenvolvedor Back-end PHP - Junior

Descrição

O profissional deve possuir, primeiramente, alta disponibilidade para poder suprir as necessidades da área, bem como ser comprometido com resultados e prazos, participar das dailys, sprint planning e sprint review.

Irá trabalhar diretamente com outros Desenvolvedores Back-end, Front-end e Mobile com os quais terá a oportunidade de trocar experiências e sugerir melhorias em arquiteturas e no seu fluxo de trabalho atual.

Sua atuação será tanto em nível de desenvolvimento como na ajuda do planejamento da arquitetura para desenvolvimento de produtos de alta complexidade quanto as necessidades de negócio abordadas.

@carlosocarvalho
carlosocarvalho / supervisord.sh
Created January 11, 2017 19:08 — forked from danmackinlay/supervisord.sh
an init.d script for supervisord
#! /bin/sh
### BEGIN INIT INFO
# Provides: supervisord
# Required-Start: $remote_fs
# Required-Stop: $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Example initscript
# Description: This file should be used to construct scripts to be
# placed in /etc/init.d.
#!/bin/bash
### Install PHP 7.1 on OPenSUSE 42.2 64Bits
### https://build.opensuse.org/package/view_file/devel:languages:php/php7/php7.spec?expand=1
### https://www.howtoforge.com/tutorial/how-to-install-php-7-on-debian/
### http://www.shaunfreeman.name/compiling-php-7-on-centos/
zypper in openssl-devel
zypper in gcc gcc-c++ libxml2-devel pkgconfig libbz2-devel curl-devel libwebp-devel