GitHub
Tests: 12 • Commercial: 2 • Pet projects: 4 • Legacy: 4
Total: 22

.NET Framework

Test
2021

Project Request

ASP.NET MVC • C# • SQL Server
Idea of the project: if someone wants to order a project development, here you can send an application.
Test
2020

ProjectC

ASP.NET MVC • C# • JSON • jQuery
JSON data processing.
Test
2020

Vehicle Maintenance

ASP.NET MVC • VB.NET • JSON
Idea of the project: if someone wants to order a project development, here you can send an application.
Test
2019

Movie Navigator

ASP.NET MVC • VB.NET
Request information about movie from IMDB.
Test
2018

Customers Exchange

ASP.NET MVC • C# • SQL Server
Automated teller machine emulation.
Test
2016

ATM

ASP.NET MVC • C#
Automated teller machine emulation.

.NET Core

Pet project
2022

Mail Daemon

.NET 8 • Console • JSON
Utility to send mails with customizable settings.

Custom

Code
2024

Buns of code

.NET Framework • C# • JavaScript
Code snippets from my projects, ready to use; tiny tests; code examples.

PHP

Test
2024

Mediabox

PHP 8 • Laravel 11 • Vue.js • Composer • SQLite
Test project for media files management.
Test
2020

Loan Castle

PHP • MariaDB
Jums jāizstrādā kāda lielāk projekta prototips. Izstrādājot prototipu, paturiet prātā, ka projektam attīstoties, šo prototipu varētu vajadzēt pilnveidot.
Test
2020

Content Management

PHP • MySQL • AJAX
Создать простой сайт, где будет страница с формой для авторизации и страница для авторизованного пользователя.
Test
2019

Laravel

PHP • Laravel • Vue.js • Composer • SQLite
Izveidot aplikāciju, kura ik pēc noteikta intervāla (60 sekundes) veic ierakstu datubāzē izmantojot Laravel freimworka iebūvēto funkcionalitāti.
Test
2019

Phone Check

PHP • JavaScript • JSON • Docker
Implement application to detect country by phone number.

Frontend

Test
2021

Forex Wall

npm • React
For this exercise, what we need is a simple live wall for tracking currencies.

Business projects

Commercial
2008

Certification Center

.NET Framework 4.8 • ASP.NET Web Forms • C# • LINQ • SQL Server • ADO.NET • Dapper • JavaScript • jQuery • Git
Transport registration and certification services in Latvia, Customer Relationship Management.
Commercial
2000

Amerikas Auto

.NET Framework 4.8 • ASP.NET Web Forms • C# • LINQ • SQL Server • ADO.NET • Entity Framework • JavaScript • jQuery • Git
Car service and spare parts for all USA and European car models, Customer Relationship Management.

Pet projects

Pet project
2023

Geolocation Assistant

.NET 8 • ASP.NET Core • C# • Web API • JSON • Git
Website for determining geolocation by IP or geotagged photo.
Pet project
2008

Web Dynamics

.NET Framework 4.8 • ASP.NET Web Forms • C# • LINQ • Web API • JSON • SQL Server • Dapper • JavaScript • jQuery • SVG • Git
Software development blog. Articles, books, videos, content management.
Pet project
2000

Blackball

.NET Framework 4.8 • ASP.NET Web Forms • C# • LINQ • Web API • JSON • XML • SQL Server • Dapper • JavaScript • jQuery • SVG • Git
My entertainment portal created from scratch.

Good old times

Legacy
2000

DOS Clock

Turbo Pascal • Assembler
Digital clock.
Legacy
2000

BrainOut

Turbo Pascal • Assembler
Tank battle game.
Legacy
1999

Airport Administrator

Turbo Pascal
Курсовая работа в институте.
Legacy
1998

Atomizer

Turbo Pascal • Assembler
Atomizer, aka «Studio2D». Graphic raster editor. AGI is my own «Atomizer Generated Image» file format.

Laravel

2019 Test

Izveidot aplikāciju, kura ik pēc noteikta intervāla (60 sekundes) veic ierakstu datubāzē izmantojot Laravel freimworka iebūvēto funkcionalitāti.

PHP Laravel Vue.js Composer SQLite
Information
Source code
  app
  Http
  Auth
  css
  js
  js
  lang
  en
  sass
  app
  data
  logs
  Unit
  src
  src
  lib
  docs
  en
  src
  docs
  en
  lib
  src
  Cron
  Cron
  src
  filp
  src
  css
  js
  Util
  src
  ORM
  Spot
  test
  Core
  Text
  Type
  Xml
  Core
  Text
  Type
  Xml
  html
  src
  src
  src
  Auth
  make
  auth
  Bus
  Auth
  Bus
  Http
  Mail
  View
  Auth
  Bus
  Http
  Http
  Json
  Log
  Mail
  html
  text
  Jobs
  View
  src
  src
  Util
  docs
  Pass
  Pass
  Pass
  doc
  src
  Curl
  doc
  f001
  f002
  f003
  f004
  f005
  f006
  f007
  f008
  src
  Date
  Spl
  src
  Lang
  List
  doc
  lib
  Node
  Expr
  Cast
  Name
  Stmt
  test
  code
  expr
  uvs
  stmt
  loop
  expr
  stmt
  Node
  Stmt
  src
  opis
  src
  dist
  lib
  src
  xml
  xml
  src
  Unit
  src
  src
  Tags
  src
  src
  src
  Call
  Node
  Call
  Util
  src
  Node
  Html
  css
  js
  Xml
  HTML
  XML
  src
  src
  src
  src
  src
  Stub
  Hook
  Util
  Log
  PHP
  cli
  1149
  1216
  1265
  1330
  1335
  1337
  1348
  1351
  1374
  1437
  1468
  1471
  1472
  1570
  2085
  2137
  2145
  2158
  2366
  2380
  2382
  2435
  244
  2448
  2724
  2725
  2731
  2811
  2830
  2972
  3093
  3107
  3156
  322
  3364
  3379
  3380
  3396
  433
  445
  498
  503
  581
  74
  765
  797
  873
  Trac
  1021
  523
  578
  684
  783
  fail
  unit
  Util
  PHP
  psr
  src
  log
  Psr
  Log
  Test
  src
  psy
  src
  Sudo
  Util
  test
  Sudo
  Util
  box
  uuid
  src
  Time
  Node
  Time
  src
  src
  diff
  src
  out
  src
  src
  src
  src
  src
  src
  src
  src
  doc
  lib
  Mime
  Pop
  Auth
  Mime
  bug
  unit
  Mime
  Auth
  dkim
  Node
  Node
  psr4
  phpt
  .dot
  b
  a
  A
  B
  C
  copy
  A
  B
  C
  one
  b
  .dot
  a
  dir
  File
  Test
  File
  test
  Test
  Log
  Log
  mime
  Part
  test
  Part
  glob
  Test
  data
  dat
  res
  Util
  Util
  Test
  css
  js
  Test
  Test
  src
  src
  Css
  Rule
  src
  src
  .env
  null
Root / vendor / nesbot / carbon / src / Carbon / Traits / Comparison.php
<?php /** * This file is part of the Carbon package. * * (c) Brian Nesbitt <brian@nesbot.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Carbon\Traits; use Carbon\CarbonInterface; use DateTimeInterface; use InvalidArgumentException; /** * Trait Comparison. * * Comparison utils and testers. All the following methods return booleans. * nowWithSameTz * * Depends on the following methods: * * @method CarbonInterface copy() * @method CarbonInterface nowWithSameTz() * @method static CarbonInterface yesterday($timezone = null) * @method static CarbonInterface tomorrow($timezone = null) */ trait Comparison { /** * Determines if the instance is equal to another * * @param \Carbon\Carbon|\DateTimeInterface|mixed $date * * @see equalTo() * * @return bool */ public function eq($date): bool { return $this->equalTo($date); } /** * Determines if the instance is equal to another * * @param \Carbon\Carbon|\DateTimeInterface|mixed $date * * @return bool */ public function equalTo($date): bool { return $this == $date; } /** * Determines if the instance is not equal to another * * @param \Carbon\Carbon|\DateTimeInterface|mixed $date * * @see notEqualTo() * * @return bool */ public function ne($date): bool { return $this->notEqualTo($date); } /** * Determines if the instance is not equal to another * * @param \Carbon\Carbon|\DateTimeInterface|mixed $date * * @return bool */ public function notEqualTo($date): bool { return !$this->equalTo($date); } /** * Determines if the instance is greater (after) than another * * @param \Carbon\Carbon|\DateTimeInterface|mixed $date * * @see greaterThan() * * @return bool */ public function gt($date): bool { return $this->greaterThan($date); } /** * Determines if the instance is greater (after) than another * * @param \Carbon\Carbon|\DateTimeInterface|mixed $date * * @return bool */ public function greaterThan($date): bool { return $this > $date; } /** * Determines if the instance is greater (after) than another * * @param \Carbon\Carbon|\DateTimeInterface|mixed $date * * @see greaterThan() * * @return bool */ public function isAfter($date): bool { return $this->greaterThan($date); } /** * Determines if the instance is greater (after) than or equal to another * * @param \Carbon\Carbon|\DateTimeInterface|mixed $date * * @see greaterThanOrEqualTo() * * @return bool */ public function gte($date): bool { return $this->greaterThanOrEqualTo($date); } /** * Determines if the instance is greater (after) than or equal to another * * @param \Carbon\Carbon|\DateTimeInterface|mixed $date * * @return bool */ public function greaterThanOrEqualTo($date): bool { return $this >= $date; } /** * Determines if the instance is less (before) than another * * @param \Carbon\Carbon|\DateTimeInterface|mixed $date * * @see lessThan() * * @return bool */ public function lt($date): bool { return $this->lessThan($date); } /** * Determines if the instance is less (before) than another * * @param \Carbon\Carbon|\DateTimeInterface|mixed $date * * @return bool */ public function lessThan($date): bool { return $this < $date; } /** * Determines if the instance is less (before) than another * * @param \Carbon\Carbon|\DateTimeInterface|mixed $date * * @see lessThan() * * @return bool */ public function isBefore($date): bool { return $this->lessThan($date); } /** * Determines if the instance is less (before) or equal to another * * @param \Carbon\Carbon|\DateTimeInterface|mixed $date * * @see lessThanOrEqualTo() * * @return bool */ public function lte($date): bool { return $this->lessThanOrEqualTo($date); } /** * Determines if the instance is less (before) or equal to another * * @param \Carbon\Carbon|\DateTimeInterface|mixed $date * * @return bool */ public function lessThanOrEqualTo($date): bool { return $this <= $date; } /** * Determines if the instance is between two others * * @param \Carbon\Carbon|\DateTimeInterface|mixed $date1 * @param \Carbon\Carbon|\DateTimeInterface|mixed $date2 * @param bool $equal Indicates if an equal to comparison should be done * * @return bool */ public function between($date1, $date2, $equal = true): bool { if ($date1->greaterThan($date2)) { $temp = $date1; $date1 = $date2; $date2 = $temp; } if ($equal) { return $this->greaterThanOrEqualTo($date1) && $this->lessThanOrEqualTo($date2); } return $this->greaterThan($date1) && $this->lessThan($date2); } /** * Determines if the instance is between two others * * @param \Carbon\Carbon|\DateTimeInterface|mixed $date1 * @param \Carbon\Carbon|\DateTimeInterface|mixed $date2 * @param bool $equal Indicates if an equal to comparison should be done * * @return bool */ public function isBetween($date1, $date2, $equal = true): bool { return $this->between($date1, $date2, $equal); } /** * Determines if the instance is a weekday. * * @return bool */ public function isWeekday() { return !$this->isWeekend(); } /** * Determines if the instance is a weekend day. * * @return bool */ public function isWeekend() { return in_array($this->dayOfWeek, static::$weekendDays); } /** * Determines if the instance is yesterday. * * @return bool */ public function isYesterday() { return $this->toDateString() === static::yesterday($this->getTimezone())->toDateString(); } /** * Determines if the instance is today. * * @return bool */ public function isToday() { return $this->toDateString() === $this->nowWithSameTz()->toDateString(); } /** * Determines if the instance is tomorrow. * * @return bool */ public function isTomorrow() { return $this->toDateString() === static::tomorrow($this->getTimezone())->toDateString(); } /** * Determines if the instance is in the future, ie. greater (after) than now. * * @return bool */ public function isFuture() { return $this->greaterThan($this->nowWithSameTz()); } /** * Determines if the instance is in the past, ie. less (before) than now. * * @return bool */ public function isPast() { return $this->lessThan($this->nowWithSameTz()); } /** * Determines if the instance is a leap year. * * @return bool */ public function isLeapYear() { return $this->rawFormat('L') === '1'; } /** * Determines if the instance is a long year * * @see https://en.wikipedia.org/wiki/ISO_8601#Week_dates * * @return bool */ public function isLongYear() { return static::create($this->year, 12, 28, 0, 0, 0, $this->tz)->weekOfYear === 53; } /** * Compares the formatted values of the two dates. * * @param string $format date formats to compare. * @param \Carbon\Carbon|\DateTimeInterface|null $date instance to compare with or null to use current day. * * @throws \InvalidArgumentException * * @return bool */ public function isSameAs($format, $date = null) { /** @var DateTimeInterface $date */ $date = $date ?: static::now($this->tz); static::expectDateTime($date, 'null'); /* @var CarbonInterface $this */ return $this->rawFormat($format) === ($date instanceof self ? $date->rawFormat($format) : $date->format($format)); } /** * Determines if the instance is in the current unit given. * * @param string $unit singular unit string * @param \Carbon\Carbon|\DateTimeInterface|null $date instance to compare with or null to use current day. * * @throws \InvalidArgumentException * * @return bool */ public function isSameUnit($unit, $date = null) { $units = [ // @call isSameUnit 'year' => 'Y', // @call isSameUnit 'week' => 'o-W', // @call isSameUnit 'day' => 'Y-m-d', // @call isSameUnit 'hour' => 'Y-m-d H', // @call isSameUnit 'minute' => 'Y-m-d H:i', // @call isSameUnit 'second' => 'Y-m-d H:i:s', // @call isSameUnit 'micro' => 'Y-m-d H:i:s.u', // @call isSameUnit 'microsecond' => 'Y-m-d H:i:s.u', ]; if (!isset($units[$unit])) { if (isset($this->$unit)) { $date = $date ? static::instance($date) : static::now($this->tz); static::expectDateTime($date); return $this->$unit === $date->$unit; } if ($this->localStrictModeEnabled ?? static::isStrictModeEnabled()) { throw new InvalidArgumentException("Bad comparison unit: '$unit'"); } return false; } return $this->isSameAs($units[$unit], $date); } /** * Determines if the instance is in the current unit given. * * @param string $unit The unit to test. * * @throws \BadMethodCallException * * @return bool */ public function isCurrentUnit($unit) { return $this->{'isSame'.ucfirst($unit)}(); } /** * Checks if the passed in date is in the same quarter as the instance quarter (and year if needed). * * @param \Carbon\Carbon|\DateTimeInterface|null $date The instance to compare with or null to use current day. * @param bool $ofSameYear Check if it is the same month in the same year. * * @return bool */ public function isSameQuarter($date = null, $ofSameYear = true) { $date = $date ? static::instance($date) : static::now($this->tz); static::expectDateTime($date, 'null'); return $this->quarter === $date->quarter && (!$ofSameYear || $this->isSameYear($date)); } /** * Checks if the passed in date is in the same month as the instance´s month. * * Note that this defaults to only comparing the month while ignoring the year. * To test if it is the same exact month of the same year, pass in true as the second parameter. * * @param \Carbon\Carbon|\DateTimeInterface|null $date The instance to compare with or null to use the current date. * @param bool $ofSameYear Check if it is the same month in the same year. * * @return bool */ public function isSameMonth($date = null, $ofSameYear = true) { return $this->isSameAs($ofSameYear ? 'Y-m' : 'm', $date); } /** * Checks if this day is a specific day of the week. * * @param int $dayOfWeek * * @return bool */ public function isDayOfWeek($dayOfWeek) { if (is_string($dayOfWeek) && defined($constant = static::class.'::'.strtoupper($dayOfWeek))) { $dayOfWeek = constant($constant); } return $this->dayOfWeek === $dayOfWeek; } /** * Check if its the birthday. Compares the date/month values of the two dates. * * @param \Carbon\Carbon|\DateTimeInterface|null $date The instance to compare with or null to use current day. * * @return bool */ public function isBirthday($date = null) { return $this->isSameAs('md', $date); } /** * Check if today is the last day of the Month * * @return bool */ public function isLastOfMonth() { return $this->day === $this->daysInMonth; } /** * Check if the instance is start of day / midnight. * * @param bool $checkMicroseconds check time at microseconds precision * * @return bool */ public function isStartOfDay($checkMicroseconds = false) { /* @var CarbonInterface $this */ return $checkMicroseconds ? $this->rawFormat('H:i:s.u') === '00:00:00.000000' : $this->rawFormat('H:i:s') === '00:00:00'; } /** * Check if the instance is end of day. * * @param bool $checkMicroseconds check time at microseconds precision * * @return bool */ public function isEndOfDay($checkMicroseconds = false) { /* @var CarbonInterface $this */ return $checkMicroseconds ? $this->rawFormat('H:i:s.u') === '23:59:59.999999' : $this->rawFormat('H:i:s') === '23:59:59'; } /** * Check if the instance is start of day / midnight. * * @return bool */ public function isMidnight() { return $this->isStartOfDay(); } /** * Check if the instance is midday. * * @return bool */ public function isMidday() { /* @var CarbonInterface $this */ return $this->rawFormat('G:i:s') === static::$midDayAt.':00:00'; } /** * Checks if the (date)time string is in a given format. * * @param string $date * @param string $format * * @return bool */ public static function hasFormat($date, $format) { try { // Try to create a DateTime object. Throws an InvalidArgumentException if the provided time string // doesn't match the format in any way. static::rawCreateFromFormat($format, $date); // createFromFormat() is known to handle edge cases silently. // E.g. "1975-5-1" (Y-n-j) will still be parsed correctly when "Y-m-d" is supplied as the format. // To ensure we're really testing against our desired format, perform an additional regex validation. // Preg quote, but remove escaped backslashes since we'll deal with escaped characters in the format string. $quotedFormat = str_replace('\\\\', '\\', preg_quote($format, '/')); // Build the regex string $regex = ''; for ($i = 0; $i < strlen($quotedFormat); ++$i) { // Backslash – the next character does not represent a date token so add it on as-is and continue. // We're doing an extra ++$i here to increment the loop by 2. if ($quotedFormat[$i] === '\\') { $regex .= '\\'.$quotedFormat[++$i]; continue; } $regex .= strtr($quotedFormat[$i], static::$regexFormats); } return (bool) preg_match('/^'.$regex.'$/', $date); } catch (InvalidArgumentException $e) { } return false; } /** * Returns true if the current date matches the given string. * * @example * ``` * var_dump(Carbon::parse('2019-06-02 12:23:45')->is('2019')); // true * var_dump(Carbon::parse('2019-06-02 12:23:45')->is('2018')); // false * var_dump(Carbon::parse('2019-06-02 12:23:45')->is('2019-06')); // true * var_dump(Carbon::parse('2019-06-02 12:23:45')->is('06-02')); // true * var_dump(Carbon::parse('2019-06-02 12:23:45')->is('2019-06-02')); // true * var_dump(Carbon::parse('2019-06-02 12:23:45')->is('Sunday')); // true * var_dump(Carbon::parse('2019-06-02 12:23:45')->is('June')); // true * var_dump(Carbon::parse('2019-06-02 12:23:45')->is('12:23')); // true * var_dump(Carbon::parse('2019-06-02 12:23:45')->is('12:23:45')); // true * var_dump(Carbon::parse('2019-06-02 12:23:45')->is('12:23:00')); // false * var_dump(Carbon::parse('2019-06-02 12:23:45')->is('12h')); // true * var_dump(Carbon::parse('2019-06-02 15:23:45')->is('3pm')); // true * var_dump(Carbon::parse('2019-06-02 15:23:45')->is('3am')); // false * ``` * * @param string $tester day name, month name, hour, date, etc. as string * * @return bool */ public function is(string $tester) { $tester = trim($tester); if (preg_match('/^\d+$/', $tester)) { return $this->year === intval($tester); } if (preg_match('/^\d{3,}-\d{1,2}$/', $tester)) { return $this->isSameMonth(static::parse($tester)); } if (preg_match('/^\d{1,2}-\d{1,2}$/', $tester)) { return $this->isSameDay(static::parse($this->year.'-'.$tester)); } $modifier = preg_replace('/(\d)h$/i', '$1:00', $tester); /* @var CarbonInterface $max */ $median = static::parse('5555-06-15 12:30:30.555555')->modify($modifier); $current = $this->copy(); /* @var CarbonInterface $other */ $other = $this->copy()->modify($modifier); if ($current->eq($other)) { return true; } if (preg_match('/\d:\d{1,2}:\d{1,2}$/', $tester)) { $current = $current->startOfSecond(); } elseif (preg_match('/\d:\d{1,2}$/', $tester)) { $current = $current->startOfMinute(); } elseif (preg_match('/\d(h|am|pm)$/', $tester)) { $current = $current->startOfHour(); } elseif (preg_match( '/^(january|february|march|april|may|june|july|august|september|october|november|december)\s+\d+$/i', $tester )) { $current = $current->startOfMonth(); $other = $other->startOfMonth(); } else { $units = [ 'month' => [1, 'year'], 'day' => [1, 'month'], 'hour' => [0, 'day'], 'minute' => [0, 'hour'], 'second' => [0, 'minute'], 'microsecond' => [0, 'second'], ]; foreach ($units as $unit => [$minimum, $startUnit]) { if ($median->$unit === $minimum) { $current = $current->startOf($startUnit); break; } } } return $current->eq($other); } }