Monday, October 4, 2021

Comparing Images in PHP

Grafika can compare how similar two images are and can also determine if two images are equal.


https://kosinix.github.io/grafika/compare-images.html

Friday, October 1, 2021

Sunday, September 5, 2021

Laravel Testing Base64 Image Upload

Base64 image save function test 

public function test_save_product_image()
{
config(['filesystems.default' => 'test']);

Storage::fake('test');
$image = UploadedFile::fake()->image('image.png');
$imageBase64 = base64_encode(file_get_contents($image->path()));
    // Image save function
    $path = Base64Image::save($imageBase64);
Storage::disk('test')->assertExists($path);
}

Thursday, July 8, 2021

How to convert HTML page to inline css

 https://templates.mailchimp.com/resources/inline-css/

Wednesday, October 29, 2014

Create MySQL trigger

Create MySQL trigger

For update
CREATE TRIGGER TRG_tableA_Insert
AFTER INSERT
   ON tableA FOR EACH ROW
BEGIN
  UPDATE tableB
  set   columnA = NEW.columnX,
        columnB = NEW.columnY,
  WHERE columnB = NEW.columnY;
END;

For insert
CREATE TRIGGER TRG_tableA_Insert
AFTER INSERT
   ON tableA FOR EACH ROW
BEGIN
  INSERT INTO tableB(columnA, columnB)
  VALUES ( NEW.columnX, NEW. columnY);
END;

Wednesday, April 9, 2014

Bootstrap sample layout

http://bit.ly/1n1cKke

HTML page layout

Ref: http://stackoverflow.com/questions/19192211/css-how-to-style-a-footer

html, body {
 height: 100%;
 margin: 0;
}

main {
 min-height: 100%;
 margin-bottom: -10px;
 background: #ddd;
 width: 600px; margin: 0 auto -10px;
}

main:after {
 content: "";
 display: block;
 height: 10px;
}

footer {
 height: 10px;
 background: #eee;
 width: 600px;
 margin: 0 auto -10px;
}