Skip to content

Instantly share code, notes, and snippets.

View nubeiro's full-sized avatar

Raúl Araya nubeiro

  • Vilafranca del Penedès
View GitHub Profile
@nubeiro
nubeiro / loopselection.vbs
Created October 28, 2023 17:22
Loops selection to set negative values on red cells
Sub LoopSelection
Dim RGBarray(1 to 3)
Set oRange = ThisComponent.CurrentSelection
For i = 0 To oRange.Rows.getCount() - 1
For j = 0 To oRange.Columns.getCount() - 1
Set oCell = oRange.getCellByPosition( j, i )
CBkC = oCell.CharColor
RGBarray(1) = Red(CBkC) : RGBarray(2) = Green(CBkC) : RGBarray(3) = Blue(CBkC)
If RGBarray(1) = 255 then
if oCell.value > 0 then
<?php
class timeVsDateTimeTest extends PHPUnit_Framework_TestCase
{
public function testTimeVsDateTime()
{
$timeZone = "Europe/Madrid";
ini_set('date.timezone', $timeZone); // otherwise next assertion won't pass.
date_default_timezone_set($timeZone);
$maybeUtc = time();
@nubeiro
nubeiro / typehinted.php
Created February 12, 2016 23:24
Testing type hints
<?php
class AMQPReader{
public function read_table() {
echo "do something";
}
}
class BaseProtocol
{
@nubeiro
nubeiro / testWeakTypesChecks.php
Created November 6, 2015 20:25
Testing default scalar type hints.
<?php
function concatStrings(string $a, string $b) {
return $a . ' - ' . $b;
}
function sum(int $a, int $b) {
return $a + $b;
}