Skip to content

Instantly share code, notes, and snippets.

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

Daniel Albuquerque danielAlbuquerque

🏠
Working from home
  • BiziFy
  • São Paulo
View GitHub Profile
@kristopherjohnson
kristopherjohnson / configure_android_sdk.sh
Created November 20, 2013 18:40
Bash script to set up ANDROID_SDK_ROOT and PATH for Android tools on Mac OS X with ADT bundle installed
# Setup for use of Android SDK tools from command line
# Set ANDROID_SDK_ROOT to point to the root of the SDK installation
export ANDROID_SDK_ROOT='/Applications/adt-bundle-mac-x86_64-20130729/sdk'
export PATH=$PATH:$ANDROID_SDK_ROOT/tools:$ANDROID_SDK_ROOT/platform-tools:$ANDROID_SDK_ROOT/tools/lib/x86_64
#Include "protheus.ch"
#Include "restful.ch"
WSRestFul XXXXXXXXXX Description "Serviço REST para tratar os arquivos de anexo da visita"
WSMethod POST Description "Dados dos arquivos enviados" WSSyntax "/xxxxxxx" PATH "/xxxxxxx" CONSUMES MULTIPART_FORM_DATA PRODUCES APPLICATION_JSON
End WSRestFul
//Só não foi tratado o envio de múltiplos arquivos em um post só, mas no portinari mesmo anexando vários arquivos, ele faz 1 post para cada um.
@CHERTS
CHERTS / zabbix_selinux_centos8_config.txt
Last active October 21, 2022 23:23
Zabbix on CentOS 8 with SELinux
If you're running the Zabbix on CentOS 8 with SELinux enabled on it, then you must do all command on this section.
Install SELinux utilities using the dnf command below.
dnf install policycoreutils checkpolicy setroubleshoot-server
Once the installation is complete, create a new directory '~/zabbix-linux' and go into it.
mkdir -p ~/zabbix-selinux
cd ~/zabbix-selinux/
@frankrowe
frankrowe / shp2gj.py
Last active November 1, 2022 17:54
PyShp, shp to geojson in python
import shapefile
# read the shapefile
reader = shapefile.Reader("my.shp")
fields = reader.fields[1:]
field_names = [field[0] for field in fields]
buffer = []
for sr in reader.shapeRecords():
atr = dict(zip(field_names, sr.record))
geom = sr.shape.__geo_interface__
buffer.append(dict(type="Feature", \
@Dadinel
Dadinel / Dnl_FWTemporaryTable.prw
Last active November 10, 2022 12:55
Exemplo de utilização comentado da FWTemporaryTable, classe que possibilidade a criação de tabelas temporárias no banco de dados
#include "protheus.ch"
user function DnlTmpTbl()
local oTable as object
local aFields as array
local nConnect as numeric
local lCloseConnect as logical
local cAlias as char
local cTableName as char
local cAreaQuery as char
@Toilal
Toilal / api.module.ts
Last active February 21, 2023 10:30
@auth0/angular2-jwt Authorization Service and HttpInterceptor supporting JWT Refresh Token (Angular 4.3+ & 5+)
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { JWT_OPTIONS, JwtInterceptor, JwtModule } from '@auth0/angular-jwt';
import { AuthorizationService } from './authorization.service';
import { environment } from '../../environments/environment';
import { HTTP_INTERCEPTORS, HttpClientModule } from '@angular/common/http';
import { RefreshTokenInterceptor } from './refresh-token-interceptor';
function jwtOptionsFactory (authorizationService: AuthorizationService) {
return {
@aedorado
aedorado / docker-compose.yml
Created December 6, 2020 16:24
Docker compose file for ELK 7.9.2
version: '3.7'
services:
elasticsearch:
image: elasticsearch:7.9.2
ports:
- '9200:9200'
environment:
- discovery.type=single-node
ulimits:
@chris-pilcher
chris-pilcher / TFSCommandLineMac.md
Last active August 17, 2023 09:52
Using TFS Online TFVC with command-line TFS utility on Mac

Install Command-Line TFS using HomeBrew on a Mac

Install Team Explorer Everywhere Command Line Client

  • Press Command+Space and type Terminal and press enter/return key.
  • Install HomeBrew by running command in Terminal app
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" < /dev/null 2> /dev/null
  • Run:
@crowcoder
crowcoder / Invoice
Created September 4, 2014 23:39
CSS/HTML only report sample implemented as a simple Invoice
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Invoice</title>
<style media="screen">
body {
font-family: 'Segoe UI','Microsoft Sans Serif',sans-serif;
}
/*
@vitorebatista
vitorebatista / tstwsrest.prw
Last active March 20, 2024 02:13
Exemplo completo webservice REST ADVPL
#include "PROTHEUS.ch"
#include "RESTFUL.ch"
#xtranslate @{Header <(cName)>} => ::GetHeader( <(cName)> )
#xtranslate @{Param <n>} => ::aURLParms\[ <n> \]
#xtranslate @{EndRoute} => EndCase
#xtranslate @{Route} => Do Case
#xtranslate @{When <path>} => Case NGIsRoute( ::aURLParms, <path> )
#xtranslate @{Default} => Otherwise