Skip to content

Instantly share code, notes, and snippets.

View kleberksms's full-sized avatar

Kleber Syd Moraes da Silva kleberksms

View GitHub Profile
@kleberksms
kleberksms / Exception
Created July 29, 2016 23:18
Exception
System.Reflection.TargetInvocationException: Uma exceção foi acionada pelo destino de uma chamada. ---> System.Net.WebException: A conexão subjacente estava fechada: Erro inesperado em um recebimento. ---> System.IO.IOException: Não é possível ler os dados da conexão de transporte: Foi forçado o cancelamento de uma conexão existente pelo host remoto. ---> System.Net.Sockets.SocketException: Foi forçado o cancelamento de uma conexão existente pelo host remoto
em System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
--- Fim do rastreamento de pilha de exceções internas ---
em System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
em System.Net.PooledStream.Read(Byte[] buffer, Int32 offset, Int32 size)
em System.Net.Connection.SyncRead(HttpWebRequest request, Boolean userRetrievedStream, Boolean probeRead)
--- Fim do rastreamento de pilha de exceções internas ---
em System.Web.Services.Protocols.WebClientProtocol.GetWebResponse(WebRequest requ
public void Configuration(IAppBuilder app)
{
var config = new HttpConfiguration();
app.UseOAuthBearerAuthentication(new OAuthBearerAuthenticationOptions());
WebApiConfig.ConfigureWebApi(config);
app.UseCors(CorsOptions.AllowAll);
var kernel = new Func<StandardKernel>(new Container().CreateKernel);
{
"dependencies": {
"Microsoft.AspNetCore.Mvc": "1.0.0",
"Microsoft.AspNetCore.Server.IISIntegration": "1.0.0",
"Microsoft.AspNetCore.Server.Kestrel": "1.0.0",
"Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0",
"Microsoft.Extensions.Configuration.FileExtensions": "1.0.0",
"Microsoft.Extensions.Configuration.Json": "1.0.0",
"Microsoft.Extensions.Logging": "1.0.0",
"Microsoft.Extensions.Logging.Console": "1.0.0",
var list = new List<Example>{
new Example{
Id = 1,
Description = "First Level",
Type = 4,
ParentId = 0
},
new Example{
Id = 2,
@kleberksms
kleberksms / example.cs
Created March 28, 2016 12:26
example.cs
public IHttpActionResult GetWithControllerRedirect(string system, string rcontroller)
{
try
{
string url = $"http://localhost:55164/api/{rcontroller}";
var request = (HttpWebRequest)WebRequest.Create(string.Format(url));
request.Method = "GET";
request.ContentType = "application/json; charset=utf-8";
request.Accept = "application/json; charset=utf-8";
var response = (HttpWebResponse)request.GetResponse();
@kleberksms
kleberksms / tableestacio.html
Created October 12, 2015 15:05
Exercício para Fórum C estácio
<table>
<tbody>
<tr>
<td colspan="3"></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
@kleberksms
kleberksms / razor
Created July 1, 2015 00:53
Colocar default value
@Html.DropDownListFor(model => model.ParentId, (IEnumerable<SelectListItem>)ViewBag.ParentId, new { @class = "form-control" })
@kleberksms
kleberksms / aula.ual
Created March 21, 2015 00:12
aula.ual
prog aula
real peso;
real altura;
real imc;
logico deveentrar;
deveentrar <- verdadeiro;
imprima "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n";
<?php
namespace Core\Entity;
class AbstractEntity
{
protected $atribute;
}
<?php
/**
* Application level Controller
*
* This file is application-wide controller file. You can put all
* application-wide controller-related methods here.
*
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
*