Skip to content

Instantly share code, notes, and snippets.

View jonataa's full-sized avatar

Jonata Weber jonataa

  • Feira de Santana - Bahia
View GitHub Profile
@jonataa
jonataa / gist:fbe2d659c20624860b17f123dd5bfe1a
Created June 11, 2024 15:03
Documentos Processo 0000109-14.2023.5.05.0561
[
{
"posicao_id": 57,
"titulo": "Intimação",
"descricao": "Intimação",
"data": "03\/04\/2024",
"tipo": "DOCUMENTO_RESTRITO",
"unique_name": "trt5-PJE-c281f81",
"suffix": "pdf",
"size": 57115,

The Toy Robot Challenge

The application is a simulation of a toy robot moving on a square tabletop, of dimensions 5 units x 5 units. There are no other obstructions on the table surface. The robot is free to roam around the surface of the table. Any movement that would result in the robot falling from the table is prevented, however further valid movement commands are still allowed. The application reads a file using a name passed in the command line, the Ifollowing commands are valid:

PLACE X,Y,F
MOVE
LEFT
RIGHT
REPORT
@jonataa
jonataa / task1.exs
Created December 19, 2019 18:37 — forked from moklett/task1.exs
Elixir Task - Crash Handling
# This demonstrates that, when using async/await, a crash in the task will crash the caller
defmodule Tasker do
def good(message) do
IO.puts message
end
def bad(message) do
IO.puts message
raise "I'm BAD!"
end
@jonataa
jonataa / preparar-ambiente.md
Last active September 7, 2019 17:34
Workshop Elixir e Phoenix
<?php
function countExtraNightBetweenDates(DateTime $begin, DateTime $end, array $extraNightHours): int
{
$interval = DateInterval::createFromDateString('1 hour');
$period = new DatePeriod($begin, $interval, $end);
$extraNightTotal = 0;
foreach($period as $dt) {
articles: [
{id: 1, created_at: "..."},
{id: 2, created_at: "..."}
],
articles_events: [
{id: 1, article_id: 1, type: "created", data: {title: "hello", category_id: 3}, created_at: "..."},
{id: 2, article_id: 1, type: "title_updated", data: {title: "hello, world"}, created_at: "..."},
{id: 3, article_id: 1, type: "published", data: {}, created_at: "..."},
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>XHR</title>
</head>
<body>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>XHR</title>
</head>
<body>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>WeberSchool - DOM</title>
</head>
<body>
function isBeatifulNumber(n, has = '4', hasnot = '9') {
const numberAsString = n.toString();
const hasFour = numberAsString.includes(has) === true;
const hasNine = numberAsString.includes(hasnot) === false;
return hasFour && hasNine;
}
const isBeatifulNumberHasThreeAndHasNotTwo = function (n) {