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 / databinding.cshtml
Last active May 30, 2018 21:08
DataBinding
<p class="note @((Foo == "Bar" ? "highlight" : ""))">This is a note</p>
<!-- OR -->
<p class="note @((Foo == Bar ? "highlight" : ""))">This is a note</p>
@functions {
private string Foo { get; set; } = "Bar";
private string Bar { get; set; }
@kleberksms
kleberksms / disable-web-security.md
Created August 9, 2018 16:47 — forked from dongyuwei/disable-web-security.md
how to disable same origin policy in chrome , for ubuntu users.

how to disable same origin policy in chrome , for ubuntu users.

vim /usr/share/applications/google-chrome.desktop

Exec=/opt/google/chrome/google-chrome --incognito --disable-web-security

--disable-web-security is the key.

public Evaluation GetEvaluationByCompany(string client, string company)
{
return DbSet.AsNoTracking().FirstOrDefault(c => c.Fk_Company == company && c.Client == client);
}
//EvaluationListViewModel
public EvaluationListViewModel GetEvaluationListByCompany(string client, string company)
{
var result = DbSet.AsQueryable()
using System.Linq;
using AvaliacoesEmpresas.Domain.Interfaces;
using AvaliacoesEmpresas.Domain.Models;
using AvaliacoesEmpresas.Infra.Data.Context;
using Microsoft.EntityFrameworkCore;
namespace AvaliacoesEmpresas.Infra.Data.Repository
{
public class EvaluationRepository : Repository<Evaluation>, IEvaluationRepository
{
[HttpPost]
[Route("{system}/{company}/{user}")]
public IActionResult Post([FromBody] CompanyEvaluationViewModel companyEvaluationViewModel)
{
if (!ModelState.IsValid)
{
NotifyModelStateErrors();
return Response(companyEvaluationViewModel);
}
@kleberksms
kleberksms / board-before.java
Last active March 13, 2019 17:20
One level of indentation per method
class Board
{
...
String board()
{
StringBuffer buf = new StringBuffer();
for (int i = 0; i < 10; i++)
{
for (int j = 0; j < 10; j++)
@kleberksms
kleberksms / board-after.java
Created March 13, 2019 17:21
One level of indentation per method
class Board
{
...
String board()
{
StringBuffer buf = new StringBuffer();
collectRows(buf);
return buf.toString();
}
@kleberksms
kleberksms / else.java
Created March 13, 2019 17:24
Rule 2: Don’t use the ELSE keyword
if (status == DONE)
{
doSomething();
}
else
{
...
}
const general = this.scheduleService.getQueryCollection(ref => ref
.where('patientId', '==', uid)
.orderBy('date', 'asc'));
const appointments = this.scheduleService.getQueryCollection(ref => ref
.where('patients', 'array-contains', uid)
.orderBy('date', 'asc'));
combineLatest([general, appointments]).pipe(
map(arr => arr.reduce((acc, cur) => acc.concat(cur))),
Material(
elevation: 15,
shadowColor: Colors.black54,
child: Column(
children: <Widget>[
Container(
decoration: BoxDecoration(color: Colors.white),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
mainAxisSize: MainAxisSize.max,