Skip to content

Instantly share code, notes, and snippets.

Fernando Andrade amdrade

Block or report user

Report or block amdrade

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@amdrade
amdrade / git-apply-patch.md
Created Nov 6, 2018 — forked from emmanueltissera/git-apply-patch.md
Generate a git patch for a specific commit
View git-apply-patch.md

Creating the patch

git format-patch -1 <sha>
OR
git format-patch -1 HEAD

Applying the patch

git apply --stat file.patch # show stats.
git apply --check file.patch # check for error before applying

@amdrade
amdrade / fc-fixed-column.css
Created Oct 15, 2018
Full Canlendar com coluna de horários fixa para visão dia
View fc-fixed-column.css
.table-responsive .fixed-column {
position: absolute;
display: inline-block;
width: auto;
border-right: 1px solid #ddd;
opacity: 0;
top: 0;
z-index: 3;
background: #fff;
color: #2d2d2d;
@amdrade
amdrade / cURL_auth.php
Last active Oct 7, 2017
PHP: Exemplo cURL com autenticação HTTP básica
View cURL_auth.php
<?php
// index.php
<?php
$aDados = ['item1' => 'value1', 'item2' => 'value2', 'dados' => ['a','b','c']];
$username = 'user';
$password = 'pass';
$sUrl = 'http://localhost/projetos/estudos/php/curl/response.php/?item3=value3&item4=value4';
$sHttpBuildQuery = http_build_query($aDados);
$ch = curl_init();
curl_setopt( $ch, CURLOPT_URL, $sUrl );
@amdrade
amdrade / fn.php
Created Sep 29, 2017
Funções PHP
View fn.php
function generateUrl() {
$protocol = $_SERVER['SERVER_PORT'] == '443' ? 'https' : 'http';
$uri = $_SERVER['REQUEST_URI'];
$Url = $protocol.'://'.str_replace('//', '/', $_SERVER['SERVER_NAME'].'/'.$uri);
return $Url;
}
@amdrade
amdrade / fn.js
Last active Nov 12, 2017
Funções JS
View fn.js
function generateUrl() {
var location = window.location,
url = window.location.href;
if (location.protocol == 'https:') {
url = 'https:' + location.href.substring(location.protocol.length);
}
return url;
}
function hasClass(el, className) {
You can’t perform that action at this time.