Skip to content

Instantly share code, notes, and snippets.

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

Mauricio Cunha mcunha98

🏠
Working from home
View GitHub Profile
<!doctype html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>CSS Message Box Styles</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<style type="text/css">
body
{
margin: 0;
//Append a custom dropdown for summernote
$(document).ready(function() {
$('.summernote').summernote({
lang: 'pt-BR',
height: 200,
dialogsInBody: true,
toolbar: [
['font', ['bold', 'italic' , 'underline', 'strikethrough', 'clear']],
['color', ['color']],

Using Git to Manage a Live Web Site

Overview

As a freelancer, I build a lot of web sites. That's a lot of code changes to track. Thankfully, a Git-enabled workflow with proper branching makes short work of project tracking. I can easily see development features in branches as well as a snapshot of the sites' production code. A nice addition to that workflow is that ability to use Git to push updates to any of the various sites I work on while committing changes.

Contents

@mcunha98
mcunha98 / git-deployment.md
Created October 25, 2020 13:34 — forked from noelboss/git-deployment.md
Simple automated GIT Deployment using Hooks

Simple automated GIT Deployment using GIT Hooks

Here are the simple steps needed to create a deployment from your local GIT repository to a server based on this in-depth tutorial.

How it works

You are developing in a working-copy on your local machine, lets say on the master branch. Most of the time, people would push code to a remote server like github.com or gitlab.com and pull or export it to a production server. Or you use a service like deepl.io to act upon a Web-Hook that's triggered that service.

@mcunha98
mcunha98 / README.md
Created October 25, 2020 13:34 — forked from nichtich/README.md
How to automatically deploy from GitHub

Deploy your site with git

This gist assumes:

  • you have an online remote repository (github / bitbucket etc.)
  • you have a local git repo
  • and a cloud server (Rackspace cloud / Amazon EC2 etc)
    • your (PHP) scripts are served from /var/www/html/
    • your webpages are executed by Apache
  • the Apache user is named www-data (may be apache on other systems)
function forceDownload(href) {
var li = Math.max(str.lastIndexOf('/'), str.lastIndexOf('\\'));
var bn = new String(str).substring(li + 1);
var anchor = document.createElement('a');
anchor.href = href;
anchor.download = bn;
document.body.appendChild(anchor);
anchor.click();
}
function syncCKEditor(value)
{
CKEDITOR.instances[value].setData(document.getElementById(value).value);
}
//carrega a response para um textarea hidden
$('#resumo').val(response.data.resumo);
//reconecta o ckeditor com o valor atualizado
syncCKEditor('resumo');
//esperado que as colunas da row tenham rel iniciando com sc-
//exemplo
//#row10 sc-nome
//#row10 sc-cpf
//etc...
function syncResponse(response, rid = "#row-")
{
if (typeof response.data !== 'undefined')
{
var highlight = false;
@mcunha98
mcunha98 / index.html
Created July 25, 2020 16:43
The Future of Ugmonk
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title></title>
<style type="text/css">
@media only screen and (max-width:480px){body,table,td,p,a,li,blockquote{-webkit-text-size-adjust:none !important}body{width:100% !important;min-width:100% !important}td[id=bodyCell]{padding:10px !important}table.kmMobileHide{display:none !important}table[class=kmTextContentContainer]{width:100% !important}table[class=kmBoxedTextContentContainer]{width:100% !important}td[class=kmImageContent]{padding-left:0 !important;padding-right:0 !important}img[class=kmImage]{width:100% !important}td.kmMobileStretch{padding-left:0 !important;padding-right:0 !important}table[class=kmSplitContentLeftContentContainer],table[class=kmSplitContentRightConte
(function($) {
$.fn.serializeFiles = function() {
var form = $(this);
var formData = new FormData();
var formParams = form.serializeArray();
$.each(form.find('input[type="file"]'), function(i, tag) {
$.each($(tag)[0].files, function(i, file) {
formData.append(tag.name, file);
});
});