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 / WaitForKey.ps1
Created August 1, 2018 23:05 — forked from jatubio/WaitForKey.ps1
Show "Press any key to continue ..." and Wait until a key is pressed #powershell
Function WaitForKey
{
<#
.Synopsis
Show "Press any key to continue ...." and Wait until a key is pressed.
.Description
Can show a text before waiting.
.Notes
@amendoncabh
amendoncabh / ReplaceIniValue_Sample3.ps1
Created August 1, 2018 23:06 — forked from jatubio/ReplaceIniValue_Sample3.ps1
PowerShell. Ini Files. Replacing a value in a key inside a section sample 3.
# Ini files
# Replacing a value in a key inside a section sample
#
# Calling Windows API function WritePrivateProfileString
# And using some C# code
#
# http://stackoverflow.com/questions/29688299/powershell-and-regex-how-to-replace-a-ini-name-value-pair-inside-a-named-sectio/29688435#29688435
$source = @"
@amendoncabh
amendoncabh / tstwsrest.prw
Created January 17, 2019 21:27 — forked from vitorebatista/tstwsrest.prw
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
@amendoncabh
amendoncabh / jquery.parseparams.js
Created May 30, 2019 21:08 — forked from kares/jquery.parseparams.js
jQuery.parseParams - parse query string paramaters into an object
/**
* $.parseParams - parse query string paramaters into an object.
*/
(function($) {
var re = /([^&=]+)=?([^&]*)/g;
var decodeRE = /\+/g; // Regex for replacing addition symbol with a space
var decode = function (str) {return decodeURIComponent( str.replace(decodeRE, " ") );};
$.parseParams = function(query) {
var params = {}, e;
while ( e = re.exec(query) ) {
@amendoncabh
amendoncabh / gist:7a56e07e1a4e47c3963d7dfe71e521b6
Created September 19, 2019 13:59 — forked from meng-hui/gist:3311509
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=
@amendoncabh
amendoncabh / .gitconfig
Created October 28, 2019 13:56 — forked from shawndumas/.gitconfig
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
@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

Bootstrap 3 Nav Menu Responsive Brand Logo Image

This demo corresponds to a this question answered on stackoverflow about Bootstrap Navbar Logos

There is a bug in Firefox with the bootstrap navbar-brand image. These methods above FIX the firefox issue by applying padding to the image and not the .navbar-brand tag removing the padding on .navbar-brand.

If you're looking for my original post using object fit method I have removed it for now because it is not fully supported in IE without a polyfill or fallback using css tables.

These are all examples of how to use a logo image in the bootstrap nav using tag. Using height on the logo along with width: auto, the image will resize to fit within the navbar and not overflow onto the page. This works exactly the same way .img-responsive does except in reverse. However, there is currently a bug in firefox so we have to apply the padding to the im

@amendoncabh
amendoncabh / Tags.php
Created October 3, 2020 23:34 — forked from asaokamei/Tags.php
PHP HTML Tag Generator Class.
<?php
/**
* @method Tags a()
* @method Tags href()
* @method Tags target()
* @method Tags style()
* @method Tags div()
* @method Tags input()
* @method Tags value()
@amendoncabh
amendoncabh / Usuarios.php
Created October 4, 2020 19:04 — forked from gilsonbp/Usuarios.php
Zend Form 1.12 usando Twitter Bootstrap e Decorators.
<?php
class Forms_Usuario extends Zend_Form {
public function init() {
$this->setMethod('post');
$this->setAttribs(array(
'class' => 'form span9',
'name' => 'form_usuarios'