Skip to content

Instantly share code, notes, and snippets.

View amendoncabh's full-sized avatar

André Mendonça amendoncabh

  • solutii
  • Belo Horizonte
View GitHub Profile
@amendoncabh
amendoncabh / jQuery.download.js
Created August 31, 2020 01:19 — forked from vivisidea/jQuery.download.js
download file using jquery
jQuery.download = function(url, data, method){
if( url && data ){
data = typeof data == 'string' ? data : jQuery.param(data);
//split params into form inputs
var inputs = '';
jQuery.each(data.split('&'), function(){
var pair = this.split('=');
inputs+='<input type="hidden" name="'+ pair[0] +'" value="'+ pair[1] +'" />';
});
//send request
@Bachsau
Bachsau / configuration_manager.py
Last active March 2, 2023 15:29
A simple abstraction of Python’s ConfigParser
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# A simple abstraction of Python’s ConfigParser.
# It features implicit type conversion and defaults through prior
# registration of settings. It can be used to save and read settings
# without bothering about the specifics of ConfigParser or the INI files
# themselves. It could also serve as a starting point to abstract
# platform-specific saving methods through its general API.
@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
@thomasdarimont
thomasdarimont / app.py
Last active July 19, 2024 02:17
Simple python example using flask, flask_oidc and keycloak
import json
import logging
from flask import Flask, g
from flask_oidc import OpenIDConnect
import requests
logging.basicConfig(level=logging.DEBUG)
app = Flask(__name__)
@danielAlbuquerque
danielAlbuquerque / reportSample.prw
Created March 13, 2017 11:35
Exemplo de relatório em ADVPL
#INCLUDE 'protheus.ch'
#INCLUDE 'topconn.ch'
User Function ImpGTRel01()
Private oReport := Nil
Private oSecCab := Nil
Private cPerg := PadR("RCOMR01", Len(SX1->X1_GRUPO))
PutSx1(cPerg,"01","Código de?" ,'','',"mv_ch1","C",TamSx3 ("B1_COD")[1] ,0,,"G","","SB1","","","mv_par01","","","","","","","","","","","","","","","","")
PutSx1(cPerg,"02","Código ate?" ,'','',"mv_ch2","C",TamSx3 ("B1_COD")[1] ,0,,"G","","SB1","","","mv_par02","","","","","","","","","","","","","","","","")
@shawndumas
shawndumas / .gitconfig
Created August 5, 2013 19:08
Using WinMerge as the git Diff/Merge Tool on Windows 64bit
[mergetool]
prompt = false
keepBackup = false
keepTemporaries = false
[merge]
tool = winmerge
[mergetool "winmerge"]
name = WinMerge
@meng-hui
meng-hui / gist:3311509
Created August 10, 2012 05:56
Inno Setup Script starting point
; Starting point of creating an Inno Setup Script
; See the Inno Setup documentation at http://www.jrsoftware.org/
#define SourceFileDir ""
#define IncludeFramework true
#define IsExternal "external"
[setup]
;name of your application
AppName=