Skip to content

Instantly share code, notes, and snippets.

View maykonmeier's full-sized avatar

Maykon Ricardo Meier maykonmeier

View GitHub Profile
@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)
@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)
<?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 / tags
Created August 27, 2014 02:47
PHP Tags
<?php echo "Tag 1"; ?>
<? echo false; ?>
<?= "Para views!" ?>
@maykonmeier
maykonmeier / gist:060744337d155559a149
Created August 3, 2014 20:04
Operadores de String
<?php
$welcome = "Bem vindo, ";
$name = "Maykon";
// Concatenação
echo $welcome . $name;
$phrase = $welcome;
@maykonmeier
maykonmeier / gist:3cebe98856311462206d
Created August 3, 2014 20:01
Operadores de incremento/decremento
<?php
$a = 10;
// ++ após a variável, executa a operação de incremento após a expressão
// Nesse caso, $c será 10 e $a será 11;
$c = $a++;
// Agora, $d e $a serão iguais, ambos terão o valor 12
$d = ++$a;
@maykonmeier
maykonmeier / gist:5e39568a2d7914c8fb16
Created August 3, 2014 19:57
Operadores lógicos
<?php
// foo() nunca será chamada
$a = (false && foo());
$b = (true || foo());
$c = (false and foo());
$d = (true or foo());
@maykonmeier
maykonmeier / gist:35419bd77c974ab9252f
Created August 3, 2014 19:53
Operador de execução
<?php
$output = `ls -la`;
echo "<pre>$output</pre>";
// <pre> é um tag HTML que formata a saída
@maykonmeier
maykonmeier / gist:f323fb4270feaf59b66f
Created August 3, 2014 19:45
Operadores de comparação
<?php
$a = $b = 10;
$name = "Maykon";
$name2 = "Joselita";
// Igual
$a == $b
@maykonmeier
maykonmeier / gist:0494530132da04dfb35e
Created August 3, 2014 19:33
Operadores de atribuição
<?php
// $a é igual a 9 agora e $b foi configurado como 4.
$a = ($b = 4) + 5;
// Operadores combinados
$a = 3;
$a += 5; // configura $a para 8, como se disséssemos: $a = $a + 5;
$b = "Bom ";