Skip to content

Instantly share code, notes, and snippets.

View maykonmeier's full-sized avatar

Maykon Ricardo Meier maykonmeier

View GitHub Profile
@maykonmeier
maykonmeier / gist:71ee012fe944c5bd5307
Last active August 29, 2015 14:04
Variables - Basic types
<?php
// Boolean
$foo = true;
echo $foo;
// Integer
$width = 1024;
$height = 768;
@maykonmeier
maykonmeier / gist:ef2eac469b840080fda6
Last active August 29, 2015 14:04
In block comment
<?php
class Post
{
public function getPost()
{
/*
This code will be ignored because it's commented
$a = 8;
echo $a;
@maykonmeier
maykonmeier / gist:ef7cc6d19be48d706dd2
Last active August 29, 2015 14:04
Inline comment
<?php
class Post
{
public function getPost()
{
// Inline comment
$a = 10;
// This method will return an int 10
@maykonmeier
maykonmeier / gist:0b2dcc6757edcf5d0930
Last active August 29, 2015 14:04
PHP inner HTML
<html>
<head>
<meta charset="utf-8" />
<meta name="description" content="short page description, to improve search engines">
<meta name="keywords" content="short keywords, separated by comma">
<title>My blog</title>
</head>
<body>
<h1>
<?php echo 'Meu nome é: '; ?>
@maykonmeier
maykonmeier / tags
Created August 27, 2014 02:47
PHP Tags
<?php echo "Tag 1"; ?>
<? echo false; ?>
<?= "Para views!" ?>
<?php
/* Working with dates
*
* 1. Everytime work with an object of type DateTime
* 2. Just use String into views or frontend using a format type
*
*/
$format = 'Y-m-d';
@maykonmeier
maykonmeier / README.md
Last active August 29, 2015 14:25
Practicing Java + Spring

Job request

You should develop an API which has this features:

  1. Should be a DispatcherServlet
  2. Should use Spring 3 (3.1 or 3.2)
  3. Should have a filter for only logged routes (described below)
  4. Only login page could be accessible without login
  5. Hibernate is optional but is a suggestion
  6. Should use maven (v3.0.5)
@maykonmeier
maykonmeier / view.phtml
Created December 3, 2012 16:16
Access another view, setTerminal true set view without layout. You can remove this method.
$htmlViewPart = new ViewModel();
$htmlViewPart->setTerminal(true)
->setTemplate('address/address/edit')
->setVariables(array('form' => $form));
$htmlOutput = $this->getServiceLocator()
->get('viewrenderer')
->render($htmlViewPart);
return $htmlOutput;
@maykonmeier
maykonmeier / NetworkConnection.cs
Created January 17, 2017 13:05
C# Class for creating a network connection using a different network credential
using System;
using System.ComponentModel;
using System.Runtime.InteropServices;
using System.Net;
public class NetworkConnection : IDisposable
{
readonly string _networkName;
public NetworkConnection(string networkName, NetworkCredential credentials)