Skip to content

Instantly share code, notes, and snippets.

View evaldobarbosa's full-sized avatar

Evaldo Barbosa evaldobarbosa

View GitHub Profile
@evaldobarbosa
evaldobarbosa / nginxproxy.md
Created January 10, 2018 18:21 — forked from soheilhy/nginxproxy.md
How to proxy web apps using nginx?

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers

[2017-11-24 18:01:20] local.ERROR: The Response content must be a string or object implementing __toString(), "object" given. {"exception":"[object] (UnexpectedValueException(code: 0): The Response content must be a string or object implementing __toString(), \"object\" given. at /Users/evaldo/Projetos/ApiatoTestes/vendor/symfony/http-foundation/Response.php:406)
[stacktrace]
#0 /Users/evaldo/Projetos/ApiatoTestes/vendor/laravel/framework/src/Illuminate/Http/Response.php(45): Symfony\\Component\\HttpFoundation\\Response->setContent(Object(Laravel\\Socialite\\Two\\User))
#1 /Users/evaldo/Projetos/ApiatoTestes/vendor/symfony/http-foundation/Response.php(200): Illuminate\\Http\\Response->setContent(Object(Laravel\\Socialite\\Two\\User))
#2 /Users/evaldo/Projetos/ApiatoTestes/vendor/laravel/framework/src/Illuminate/Routing/Router.php(724): Symfony\\Component\\HttpFoundation\\Response->__construct(Object(Laravel\\Socialite\\Two\\User))
#3 /Users/evaldo/Projetos/ApiatoTestes/vendor/laravel/framework/src/Illuminate/
<snippet>
<content><![CDATA[
<link rel="import" href="../bower_components/polymer/polymer.html">
<dom-module id="${TM_FILENAME/(\.html)/()/g}">
<template>
<style>
:host {
display: block;
}
php -S 192.168.7.205:8080 server.php & stunnel4 -d 443 -r 8080
<?php
//Diretórios com arquivos estáticos servidos pela sua aplicacao
$static = array("bower_components", "images", "css", "js", "scripts", "fonts", "styles", "html", "blank");
//Verificando se o arquivo é estático
$ex = explode("/", $_SERVER['REQUEST_URI']);
if (in_array($ex[1], $pastas)) {
return false; // serve the requested resource as-is.
}
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<link rel="stylesheet" type="text/css" href="/css/bootstrap/css/bootstrap.css"/>
<script type="text/javascript" src="/js/jquery/jquery-1.9.1.js"></script>
<script>
$(document).ready(function() {
$('#transform_val').bind('click',function(e) {
@evaldobarbosa
evaldobarbosa / gist:733aa382b34529977b0e
Last active August 29, 2015 14:10
Controlando comboboxes
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Controlando comboboxes</title>
<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css" type="text/css" rel="stylesheet" />
<script src="https://code.jquery.com/jquery-2.1.1.min.js"></script>
<script type="text/javascript">
var pagina = (new function() {
var self = this;
<?php
$texto = '<p class="abc" id="abc1">Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat. Duis aute irure dolor in <a href="#">reprehenderit</a> in voluptate velit esse
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>';
$maximoCaracteres = 150;
@evaldobarbosa
evaldobarbosa / vagrant-correcao-problema-apt-get
Created June 23, 2014 23:55
Resolvendo o problema do vagrant que não roda o apt-get
sudo apt-get install dkms
sudo apt-get install dpkg-dev virtualbox-dkms
#install linux headers for your distro
sudo apt-get install linux-headers-$(uname -r)
#reconfigure virtualbox-dkms
sudo dpkg-reconfigure virtualbox-dkms
<?php
/**
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/ZendSkeletonApplication for the canonical source repository
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
return array(