Skip to content

Instantly share code, notes, and snippets.

View luscas's full-sized avatar
📍
home office

Lucas luscas

📍
home office
View GitHub Profile
version: "3.9"
volumes:
kong-db:
driver: local
networks:
internal:
external: false
import os
from flask import Flask
from flask import request
from pika.compat import xrange
from pyspark.sql import SparkSession
app = Flask(__name__)
import { withAuth } from "next-auth/middleware";
export default withAuth({
callbacks: {
authorized: ({ token }) => {
if (token) {
const expiration = Number(token.exp) * 1000;
const now = Date.now();
if (expiration < now) {
class Noticia {
String title;
DateTime createdAt;
Noticia(this.title, this.createdAt);
}
void main() {
List<Noticia> registers = [
Noticia("Primeira postagem", DateTime(2022,07,01)),
@luscas
luscas / AuthController.php
Created September 24, 2021 20:44
Renanzin
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
class AuthController extends Controller
{
// Muda a rota pra AuthController@index ao invés de dashboard pra seguir o padrão REST (index, show, update, create, delete...)
@luscas
luscas / alunos.c
Created August 10, 2021 23:41
merda
#include <stdio.h>
#include <stdlib.h>
#include <locale.h>
void ordenaVetor(int v[], int n) {
int i = 0, j = 0, menor = 0, troca = 0;
/* percorre todo o vetor */
for(i = 0; i < n-1; i++) {
/* procura o menor elemento para a posi��o "i" */
@luscas
luscas / shopping_cart.js
Created August 3, 2021 12:18
Using Array.reduce to sum a property in an array of objects - Total Shopping Cart
const products = [
{
id: 1,
title: "Banho",
description: "Realizamos a higiene completa do seu pet",
quantity: 5,
price: 79.9,
},
{
id: 2,
This file has been truncated, but you can view the full file.
{"v":"5.5.7","meta":{"g":"LottieFiles AE 0.1.20","a":"","k":"","d":"","tc":""},"fr":30,"ip":0,"op":300,"w":1200,"h":800,"nm":"Hero1","ddd":0,"assets":[{"id":"image_0","w":1200,"h":800,"u":"","p":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAABLAAAAMgCAYAAAAz4JsCAAAgAElEQVR4XuzdUXITR9g/6m5Jdi45O8g/NzbYlYKsIN8OYAd4B5kdMOxA7MDsAHYQVnCgvrKDuTlhB/HdQbam/zWyMEpwgs24rR7No7uA9E738zapml9N98TgQ4AAAQIECBAgQIAAAQIECBAgQKBggVjw2AyNAAECBAgQIECAAAECBAgQIECAQBBgWQQECBAgQIAAAQIECBAgQIAAAQJFCwiwim6PwREgQIAAAQIECBAgQIAAAQIECAiwrAECBAgQIECAAAECBAgQIECAAIGiBQRYRbfH4AgQIECAAAECBAgQIECAAAECBARY1gABAgQIECBAgAABAgQIECBAgEDRAgKsottjcAQIECBAgAABAgQIECBAgAABAgIsa4AAAQIECBAgQIAAAQIECBAgQKBoAQFW0e0xOAIECBAgQIAAAQIECBAgQIAAAQGWNUCAAAECBAgQIECAAAECBAgQIFC0gACr6PYYHAECBAgQIECAAAECBAgQIECAgADLGiBAgAABAgQIECBAgAABAgQIEChaQIBVdHsMjgABAgQIECBAgAABAgQIECBAQIBlDRAgQIAAAQIECBAgQIAAAQIECBQtIMAquj0GR4AAAQIECBAgQIAAAQIECBAgIMCyBggQIECAAAECBAgQIECAAAECBIoWEGAV3R6DI0CAAAECBAgQIECAAAECBAgQEGBZAwQIECBAgAABAgQIECBAgAABAkULCLCKbo/BESBAgAABAgQIECBAgAABAgQICL
@luscas
luscas / wallet.txt
Created March 31, 2021 00:46
My Wallet
0x1ad31a923af5ba1a6fdf3c180679cfa1ecd3f9d1
@luscas
luscas / game.py
Created September 8, 2020 14:02
Desafio IF
from random import randint
class Jogo:
# Multiplayer
continua = True
players = [] # Players
chute = 0 # Chute
tentativas = [0,0] # Total de tentativas restantes
nivel_tentativas = 0 # Total de tentativas por nivel
pontuacao = [100, 100] # Pontuação