Skip to content

Instantly share code, notes, and snippets.

View vitorpacheco's full-sized avatar

Vitor Pacheco vitorpacheco

  • Solutis Tecnologias
  • Brasil, Salvador - BA
View GitHub Profile
class Main {
static void calc_err(float xb, float x) {
float erroAbsoluto = Math.abs(x - xb);
float erroRelativo = Math.abs(erroAbsoluto/xb);
System.out.printf("%.5f %.5f\n", erroAbsoluto, erroRelativo);
}
public static void main(String[] args) {
@vitorpacheco
vitorpacheco / ListAdapter.kt
Last active April 1, 2020 13:06
ListAdapter for RecyclerView
#if (${PACKAGE_NAME} && ${PACKAGE_NAME} != "")package ${PACKAGE_NAME}#end
import androidx.recyclerview.widget.RecyclerView
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.recyclerview.widget.AsyncListDiffer
import androidx.recyclerview.widget.DiffUtil
#parse("File Header.java")
@vitorpacheco
vitorpacheco / show-indexes.js
Created February 4, 2019 13:57 — forked from ixti/show-indexes.js
Small script that extracts all non-default indexes from MongoDB
rs.slaveOk();
db.getCollectionNames().forEach(function(coll) {
db[coll].getIndexes().forEach(function(index) {
if ("_id_" !== index.name) {
print("db." + coll + ".createIndex(" + tojson(index.key) + ")");
}
});
});
#!/bin/bash
fuser 9443/tcp
fuser 9080/tcp
fuser 8878/tcp
fuser 8879/tcp
fuser 9060/tcp
kill -9 `ps -ef | grep java | awk -F" " '{print $2}'`
#!/bin/bash
WAS_HOME=/opt/IBM/WebSphere/AppServer/profiles/AppSrv01
EAR=$1
printf "[DEPLOY] --- Gerando versão"
printf "\n"
mvn -e clean package -DskipTests
printf "[DEPLOY] --- Copiando EAR..."
# vim:set ft=dockerfile:
# Create image based on the official Node 9.6.1 image from dockerhub
FROM php:7.2.2-fpm
# Install dependecies
RUN apt-get update && apt-get install -y \
zlib1g-dev \
libmemcached-dev \
libfreetype6-dev \
libjpeg62-turbo-dev \
@vitorpacheco
vitorpacheco / Dockerfile-backend
Created March 24, 2018 21:02
laravel-angular
# vim:set ft=dockerfile:
# Create image based on the official Node 9.6.1 image from dockerhub
FROM php:7.2.2-fpm
# Install dependecies
RUN apt-get update && apt-get install -y \
zlib1g-dev \
libmemcached-dev \
libfreetype6-dev \
libjpeg62-turbo-dev \
{
"resourceType": "Practitioner",
"id": "#8295",
"contained": [
{
"resourceType": "PractitionerRole",
"id": "1",
"active": true,
"period": {
"start": "2017-12-07T00:00:00-03:00"
@vitorpacheco
vitorpacheco / importacao-fco.json
Last active November 27, 2017 17:42
importacao-fco
{
"resourceType": "Bundle",
"type": "message",
"entry": [
{
"resource": {
"resourceType": "MessageHeader",
"event": {
"system": "http://hl7.org/fhir/message-events",
"code": "admin-notify",
curl -X POST \
'http://localhost:8000/api/v1/fhir/$process-message' \
-H 'accept: application/fhir+json' \
-H 'authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjU5ZjM4MzM3ZDJhYTRjM2U2N2YwMWY3ZSIsInN1YiI6InZpdG9yLmNvc3RhIiwibmFtZSI6IlZpdG9yIFBhY2hlY28gQ29zdGEiLCJzdXJuYW1lIjoiQ29zdGEiLCJwZXJtaXNzaW9ucyI6WyJhcHA6aG9tZSIsImFwcDpjb21wb3NpY2FvIiwiYXBwOmRhc2hib2FyZCIsImFwcDphdGVuZGltZW50byIsImFwcDpwYWNpZW50ZSIsImFwcDpwcm9udHVhcmlvIiwiYXBwOm9yZ2FuaXphY2FvIiwiYXBwOnByb2Zpc3Npb25hbCIsImFwcDphZG1pbmlzdHJhZG9yIl0sIm1haWwiOiJ2aXRvci5jb3N0YUBzb2x1dGlzLmNvbS5iciIsImlhdCI6MTUwOTEzMTA2MywiZXhwIjoxNTE2OTA3MDYzfQ.t1czVOcY4-Mn30BzDsuLpHbV7hTiHT9b2f-CgDe_bOUOFIi173Ebg7KPJ-0nsU4n1dJU6WEpqO5IPaiNlH-77nGiglpJTQjmvUC-RjPH2DjnBVDSgJ3DfCxo4KWUJj3rggqAUPrKvgztHQVJfsHM2rIdt_j-p7kYlPhXd9x-QJBu2HMyVIV5rmgDY8FCuq8zWVdNbHg61M_V3J20vhurlSHkLfy2jd8RlnoisRlsf21fECj6dcXeZcABuE13Inu1aXSSlTEn16_HHDLPuuS6aOMNYxYnnAogi2JdADWGv_1g3mlEUwdCzgstnBocBI-Yp3rPUzOuAhgJ1diNOt_X6yVrKhGpuo1c5XluW2cwUlh7HcuxS4wf1bkvdhCL65UcqZzwESQBoCGjX