Skip to content

Instantly share code, notes, and snippets.

Avatar

Maykon Ricardo Meier maykonmeier

  • Joinville/SC
View GitHub Profile
@maykonmeier
maykonmeier / NetworkConnection.cs
Created Jan 17, 2017
C# Class for creating a network connection using a different network credential
View NetworkConnection.cs
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 Aug 29, 2015
Practicing Java + Spring
View README.md

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)
View date
<?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';
View tags
<?php echo "Tag 1"; ?>
<? echo false; ?>
<?= "Para views!" ?>
View gist:060744337d155559a149
<?php
$welcome = "Bem vindo, ";
$name = "Maykon";
// Concatenação
echo $welcome . $name;
$phrase = $welcome;
@maykonmeier
maykonmeier / gist:3cebe98856311462206d
Created Aug 3, 2014
Operadores de incremento/decremento
View gist:3cebe98856311462206d
<?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;
View gist:5e39568a2d7914c8fb16
<?php
// foo() nunca será chamada
$a = (false && foo());
$b = (true || foo());
$c = (false and foo());
$d = (true or foo());
View gist:35419bd77c974ab9252f
<?php
$output = `ls -la`;
echo "<pre>$output</pre>";
// <pre> é um tag HTML que formata a saída
View gist:f323fb4270feaf59b66f
<?php
$a = $b = 10;
$name = "Maykon";
$name2 = "Joselita";
// Igual
$a == $b
View gist:0494530132da04dfb35e
<?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 ";
You can’t perform that action at this time.