Skip to content

Instantly share code, notes, and snippets.

View gmsantos's full-sized avatar

Gabriel Machado gmsantos

View GitHub Profile
@gmsantos
gmsantos / settings.json
Last active May 18, 2023 22:19
Windows Terminal
// This file was initially generated by Windows Terminal 1.0.1401.0
// It should still be usable in newer versions, but newer versions might have additional
// settings, help text, or changes that you will not see unless you clear this file
// and let us generate a new one for you.
// To view the default settings, hold "alt" while clicking on the "Settings" button.
// For documentation on these settings, see: https://aka.ms/terminal-documentation
{
"$schema": "https://aka.ms/terminal-profiles-schema",
"defaultProfile": "{c6eaf9f4-32a7-5fdc-b5cf-066e8a4b1e40}",
@gmsantos
gmsantos / Vagrantfile
Created January 23, 2017 21:01
VM for season php courses
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure(2) do |config|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at
@gmsantos
gmsantos / setup-proxy-phpconf.sh
Created December 7, 2016 13:05
Setup Proxy on Docker Engine
#!/bin/bash
mkdir /etc/systemd/system/docker.service.d
echo '[Service]\nEnvironment="HTTP_PROXY=http://10.2.0.1:3128/"' > /etc/systemd/system/docker.service.d/http-proxy.conf
systemctl daemon-reload
systemctl restart docker
@gmsantos
gmsantos / php_pratico_streams.md
Created July 15, 2016 22:51 — forked from alganet/php_pratico_streams.md
PHP Prático: Streams

PHP Prático: Streams

A palavra stream significa corrente. Em geral, qualquer conexão de rede é uma stream, e existem vários tipos de protocolos para streams. Esses protocolos definem como os dados fluem na corrente.

No PHP, vários protocolos são suportados de forma transparente:

<?php
<?php
class teste{
protected $dados = [];
public function __constructor(array $dados){
$this->dados = $dados;
}
<?php
/**
* Description of Ovni
*
* @author Gabriel Machado
*/
class Ovni {
protected $cometaGrupo = [];
@gmsantos
gmsantos / Configuracao.php
Created December 9, 2014 18:45
Constantes PHP
<?php
define('FOO','Hello World');`
@gmsantos
gmsantos / route
Last active August 29, 2015 14:07
Route::* Laravel
<?php
/*
Em vez de :
Route::any('/', function(){
if (Request::getMethod == 'POST'){
// lógica login
<html>
<head><title>Calendar</title></head>
<body>
<form method="post" action="calendar.php">
<label>Year: </label>
<select name="year">
<option>2000</option>
<option>2001</option>
<option>2002</option>
<option>2003</option>
<?php
//$IdUserOnline2 = array('a','b','c'); // Array não definida
$IdUserComum2 = array('a','b','c');
//$IdUserNovo2 = array('a','b','c'); // Array não definida
$IdUserOnline2 = isset($IdUserOnline2) ? $IdUserOnline2 : array();
$IdUserComum2= isset($IdUserComum2) ? $IdUserComum2 : array();
$IdUserNovo2= isset($IdUserNovo2) ? $IdUserNovo2 : array();