📚 Manual completo de Twilight Imperium 4ª Edición reescrito con estilo didáctico y accesible.
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
| # _______ _______ __ __ | |
| # |__ _ |__ _| \ \ / / | |
| # | | | | \ V / | |
| # | | | | > < | |
| # | | | | / /\ \ | |
| # |_| |_| /_/ \_\ | |
| # | |
| # James A. Moorer | |
| use_bpm 60 |
Complete name: Back to the Future in the Grocery Store Kata
This kata is about managing a special grocery store inventory. The task is to keep track of fruits and vegetables, organize and sort them, but with a twist—we need to manage the inventory over time!
Every method in this kata requires a date parameter to indicate when the changes should take effect.
Your job is to create a system that can accept changes to the inventory at any date, and then allow us to see the state of the inventory at any given date.
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 { BenchmarkRunResult } from "https://deno.land/std/testing/bench.ts"; | |
| function typicalDeviation(data: number[]) { | |
| const avg = data.reduce((a, b) => a + b) / data.length; | |
| const squareDiffs = data.map((value) => { | |
| const diff = value - avg; | |
| const sqrDiff = diff * diff; | |
| return sqrDiff; | |
| }); | |
| const avgSquareDiff = squareDiffs.reduce((a, b) => a + b) / data.length; |
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 toInteger = digitString => parseInt(digitString) | |
| const isValidInteger = digit => !isNaN(digit) | |
| const isGreaterOrEqualThan = n1 => n2 => n1 >= n2 | |
| const isLessOrEqualThan = n1 => n2 => n1 <= n2 | |
| const isValidIp = ip => ip | |
| .split(".") | |
| .map(toInteger) | |
| .filter(isValidInteger) | |
| .filter(isGreaterOrEqualThan(255)) |
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
| package com.acidtango.javaboilerplate; | |
| import org.jetbrains.annotations.Contract; | |
| import org.jetbrains.annotations.NotNull; | |
| import java.util.Arrays; | |
| import java.util.Optional; | |
| import java.util.function.Predicate; | |
| public class IpValidator { |
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
| Cipher::EncryptBlock | |
| CipherAES::Encrypt | |
| CipherAES::EncryptBlocks | |
| Cipher::EncryptBlocks | |
| CipherAES::Encrypt | |
| CipherAES::Encrypt | |
| CipherAES::Encrypt | |
| CipherAES::Encrypt | |
| CipherAES::Encrypt | |
| CipherAES::Encrypt |
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
| defmodule StringCalculator do | |
| def has_delimiter?(str) do | |
| String.starts_with?(str, "//") | |
| end | |
| def extract_delimiter(str) do | |
| {String.at(str, 2), String.slice(str, 3..-1)} | |
| end | |
| def replace_whitespace_with_separator(str, separator) do |
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 flow from 'lodash/flow' | |
| function Toggler(toggler) { | |
| // PRIVATE ==================================================================== | |
| function updateSelectedTypes (types) { | |
| return { | |
| ...toggler, | |
| types | |
| } |
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 "https://gist.githubusercontent.com/DanielRamosAcosta/2f773d815f5434f185c59aec1bab418c/raw/a442cdd8699e39ab9855cbaa571a79049a7b67d4/axios.ts" | |
| // Make a request for a user with a given ID | |
| axios.get('http://jsonplaceholder.typicode.com/users/1') | |
| .then(response => { | |
| // handle success | |
| console.log("User name:", response.data.name); | |
| }) | |
| .catch(error => { | |
| // handle error |
NewerOlder