Skip to content

Instantly share code, notes, and snippets.

View jfbueno's full-sized avatar
🏠
Working from home

Jéf Bueno jfbueno

🏠
Working from home
View GitHub Profile
public async Task<ActionResult> Index(int? pagina, TituloViewModel viewModel)
{
var paginaNaoNula = pagina ?? 1;
Guid usuarioId = Guid.Parse(User.Identity.GetUserId());
var clientes = await db.Clientes.Where(c => c.UsuarioId == usuarioId).Include(cliente => cliente.Usuario).AsQueryable();
if (!string.IsNullOrEmpty(viewModel.NomeCompleto))
clientes = clientes.Where(p => p.Nome.Contains(viewModel.NomeCompleto));
li $s0, 2 # Carregar o valor de A
li $s1, 14 # Carregar o valor de B
main:
move $a1, $s0 # Fazer com que $a1 receba o valor de A, para usar na função
jal converter # Chamar a função que converte pra 7 segmentos
move $a1, $s1 # Mesma coisa que acima, só que usando o B
jal converter # --
contar1:
@jfbueno
jfbueno / main.py
Last active August 24, 2017 19:19
import time
from math import sqrt, ceil
def checkPrime(num, baseList):
for p in baseList:
if(p > ceil(sqrt(num))): break
if num % p == 0:
return False
return True
@jfbueno
jfbueno / Program.cs
Last active February 7, 2018 11:07
SimpleDateTimeApi
using System;
using System.Globalization;
namespace JefersonBueno
{
public class Program
{
public static string ChangeDate(string date, char op, long value)
{
var toAdd = Math.Abs(value);
<html>
<head>
<style>
@media print {
@page {
size: A4 landscape;
margin: 0;
@bottom-left {
content: counter(page) "/" counter(pages);
@jfbueno
jfbueno / main.cs
Last active February 5, 2019 23:21
filtro-array-1 created by jfbueno - https://repl.it/@jfbueno/filtro-array-1
using System.Linq;
using System.Collections.Generic;
using static System.Console;
class MainClass
{
public static void Main (string[] args)
{
var numeros = Enumerable.Range(1, 31);
WriteLine("Números de 1 a 30");
@jfbueno
jfbueno / main.cs
Last active February 5, 2019 23:23
filtro-where created by jfbueno - https://repl.it/@jfbueno/filtro-where
using System.Linq;
using System.Collections.Generic;
using static System.Console;
class MainClass
{
public static void Main (string[] args)
{
var numeros = Enumerable.Range(1, 31);
@jfbueno
jfbueno / meu-where.cs
Last active February 6, 2019 00:14
filtro-meuwhere created by jfbueno - https://repl.it/@jfbueno/filtro-meuwhere
using System;
using System.Linq;
using System.Collections.Generic;
using static System.Console;
class MainClass
{
public static void Main (string[] args)
{
var numeros = Enumerable.Range(1, 31);
@jfbueno
jfbueno / meuwhere-yield.cs
Created February 6, 2019 00:19
meuwhere-yield.cs
public static IEnumerable<T> MeuWhere<T>(this IEnumerable<T> src, Func<T, bool> predicate)
{
foreach(var item in src)
if (predicate(item))
yield return item;
}
public class EventosRepository
{
public Evento[] ObterEventos()
{
var eventos = Connection.Query<Evento>("Select * From Eventos Limit X, Y");
ComporRelacionados(eventos);
return eventos;
}
private void ComporRelacionados(Evento[] eventos)