This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen 8080 default_server; | |
listen [::]:8080 default_server; | |
server_name _; | |
root /var/www/html; | |
index index.php index.html index.htm; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BEGIN; | |
/* SETUP */ | |
CREATE EXTENSION IF NOT EXISTS "pgcrypto"; | |
CREATE EXTENSION IF NOT EXISTS "uuid-ossp"; | |
CREATE TABLE Users | |
( | |
user_id UUID PRIMARY KEY DEFAULT uuid_generate_v4(), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
- input tem ate 20chars, sendo alfa-numérico lowercase | |
- padrão : 2 ou mais caractéres adjacentes na string | |
forem repetidos pelo menos uma vez | |
"aabecaa" => "yes aa" => because "[aa]bec[aa]" | |
"abbbaac" => "no null" => because not found pattern | |
"aabejiabkfabed" => "yes abe" => becayse "a[abe]jiabkf[abe]d" | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function closestEnemy(arr){ | |
// console.time('PERFORMANCE_1') | |
const position = arr.indexOf(1) | |
let closestDistance = Infinity | |
for ( | |
let i = 0; | |
i < arr.length; | |
i++ | |
) { | |
const foundEnemy = arr[i] === 2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function LRUCache(strArr) { | |
const CACHE_SIZE = 5 | |
const cache = [] | |
// // console.time('ARRAY_PERFORMANCE') | |
// strArr.forEach( | |
// char => { | |
// const charIndex = cache.indexOf(char) | |
// if (charIndex === -1) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env zx | |
/** | |
* This script aims to add multiple environment variables to your Gitlab settings. | |
* | |
* Useful when setting up a new pipeline. | |
* | |
* @author Anderson Bosa < https://github.com/andersonbosa > | |
* | |
* @example |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name animeszone.net upgrader | |
// @match https://animeszone.net/* | |
// @version 99 | |
// @author https://twitter.com/t4inha | |
// @description 8/21/2023, 1:52:49 PM | |
// ==/UserScript== | |
const CUSTOM_CSS = ` | |
#tt-wp > header > header > nav { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import winston from 'winston' | |
const createWinstonLogger = () => winston.createLogger({ | |
levels: winston.config.syslog.levels, | |
transports: [ | |
new winston.transports.Console({ | |
level: 'info', | |
format: winston.format.combine( | |
winston.format.colorize({ all: true }), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ------------------------------- lib | |
import amqp from 'amqplib' | |
import { v4 as uuidv4 } from 'uuid' | |
import { | |
Broker, | |
BrokerBinding, | |
BrokerConfig, |