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
| version: '3' | |
| services: | |
| loki: | |
| image: grafana/loki:2.0.0 | |
| ports: | |
| - "3100:3100" | |
| command: -config.file=/etc/loki/local-config.yaml | |
| promtail: | |
| image: grafana/promtail:2.0.0 | |
| volumes: |
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
| mkdir ~/docker | |
| chmod 777 ~/docker | |
| # Create network to all containers | |
| docker network create dockernet | |
| # Mongo | |
| docker run -v ~/docker/mongo/data:/data/db -p 27017:27017 --name mongodb --network dockernet -d mongo | |
| # CouchDB |
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
| # ´a ´c ~a | |
| setxkbmap -model abnt2 -layout us -variant intl | |
| # á ç ã |
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 axios from 'axios'; | |
| import cheerio from 'cheerio'; | |
| import logger from './lib/logger'; | |
| const BASE_URL = 'https://www.airbnb.com'; | |
| const URL = `${BASE_URL}/s/Miami--FL--United-States/homes`; | |
| const CSS_QUERY = '._fhph4u ._8ssblpx'; | |
| const CSS_QUERY_PAGINATOR = 'nav[data-id="SearchResultsPagination"] > ul > li a[aria-label="Next"]'; | |
| const content = { |
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
| set -g terminal-overrides 'xterm:colors=88' | |
| set -g default-terminal "screen-256color" |
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
| fn add_number_bad_way(board: Vec<Vec<i32>>, point: Vec<i32>, number: i32) -> Vec<Vec<i32>> { | |
| return board.iter().enumerate().map(|(column_index, line)| { | |
| return line.iter().enumerate().map(|(line_index, value)| { | |
| if column_index as i32 == point[0] && line_index as i32 == point[1] { | |
| return number; | |
| } | |
| return *value; | |
| }).collect(); | |
| }).collect(); | |
| } |
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
| const readlineSync = require('readline-sync'); | |
| const printBoard = (board) => { | |
| const f = (n) => { | |
| const size = n.toString().length; | |
| const spaces = 5-size; | |
| return ' '.repeat(spaces) + n.toString() + ' '; | |
| }; | |
| textToPrint = []; |
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
| const printBoard = (board) => { | |
| const format = (n, stringSize) => { | |
| const size = n.toString().length; | |
| return ' '.repeat(stringSize - spaces) + n + ' '; | |
| } | |
| const textToPrint = board.map((column, idxLine) => { | |
| const line = column.map((_, idxColumn) => format(board[idxColumn][idxLine])); | |
| return line.join('|'); | |
| }); | |
| console.log('-'.repeat(4*5+5)); |
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
| /** | |
| * @param line Array Old board array | |
| * @param result New array with new state. Start empty | |
| * @param lineWithoutZerosMemoized array list of numbers in line without 0 | |
| */ | |
| const moveLineUp = (line, results=[], lineWithoutZerosMemoized=null) => { | |
| // line is used like a counter to add in results | |
| if(line.length === 0) return results; // If line is empty, get out recursion | |
| const lineWithoutZeros = lineWithoutZerosMemoized || line.filter((n)=>n > 0); |
NewerOlder