This file contains 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
records = [ | |
%{"data" => "2023-07-13", "qtd" => 12}, | |
%{"data" => "2023-07-14", "qtd" => 30}, | |
%{"data" => "2023-07-13", "qtd" => 4}, | |
%{"data" => "2023-07-14", "qtd" => 98}, | |
%{"data" => "2023-07-12", "qtd" => 4}, | |
%{"data" => "2023-07-12", "qtd" => 8}, | |
%{"data" => "2023-07-12", "qtd" => 31}, | |
%{"data" => "2023-07-15", "qtd" => 74}, | |
%{"data" => "2023-07-13", "qtd" => 12}, |
This file contains 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
<h1>International Telephone Input - BOOTSTRAP INPUT GROUP</h1> | |
<form> | |
<div class="input-group"> | |
<input type="tel" class="form-control"> | |
<span class="input-group-addon">Tel</span> | |
</div> | |
<br> | |
<div class="input-group"> | |
<input type="tel" class="form-control"> | |
<span class="input-group-addon">Tel</span> |
This file contains 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
# Memcached Dockerfile | |
# | |
# VERSION 0.0.1 | |
FROM debian:jessie | |
# add our user and group first to make sure their IDs get assigned consistently, regardless of whatever dependencies get added | |
RUN groupadd -r memcache && useradd -r -g memcache memcache | |
RUN apt-get update && apt-get install -y libevent-2.0-5 && rm -rf /var/lib/apt/lists/* |
This file contains 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
class Calculator | |
def calculate(input) | |
splited = split_string(input) | |
mapped = splited.map(&:to_i) | |
if (input.include?('+')) | |
return mapped.reduce(:+) | |
elsif (input.include?('-')) | |
return mapped.reduce(:-) |
This file contains 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 java.util.Date; | |
public class Block { | |
public String hash; | |
public String previousHash; | |
private String data; | |
private long timestamp; | |
public Block(String data, String previousHash) { | |
this.data = data; |
This file contains 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 Anagram do | |
@moduledoc """ | |
iex(1) > Anagram.match("dog", ["apple", "cow", "god"]) | |
["god"] | |
""" | |
@spec match(String.t(), list()) :: list() | |
def match(base, candidates) when is_list(candidates) do | |
base_fingerprint = fingerprint(base) |
This file contains 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 Fibonacci do | |
def start(n) do | |
start = :os.system_time(:seconds) | |
fibonacciNumber = getNumber(n) | |
finish = :os.system_time(:seconds) | |
totalTime = finish - start | |
IO.puts("The fibonacci number was #{fibonacciNumber}") | |
IO.puts("Fibonacci for number placed #{n} finished in #{totalTime} seconds!") | |
end |
This file contains 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
[alias] | |
foo="!f() { echo "begin arg=$1/$2/end"; }; f" | |
# Short for status | |
st = status | |
# View the current working tree status using short format | |
s = status -s |
This file contains 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
<?php | |
$handle = fopen ("php://stdin", "r"); | |
function timeConversion($s) { | |
// Complete this function | |
$dateTime = DateTime::createFromFormat('h:i:sa', $s); | |
return $dateTime->format('H:i:s'); | |
} |
This file contains 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
<?php | |
$handle = fopen ("php://stdin", "r"); | |
function birthdayCakeCandles($n, $ar) { | |
// Complete this function | |
$a = array_count_values($ar); | |
rsort($a, SORT_NUMERIC); | |
return reset($a); | |
} |
NewerOlder