Skip to content

Instantly share code, notes, and snippets.

View damijanc's full-sized avatar

Damijan Cavar damijanc

View GitHub Profile
@damijanc
damijanc / sample.php
Created September 13, 2018 11:53
Example on how to download an Excel file created with PhpSpreadsheet
<?php
$streamedResponse = new StreamedResponse();
$streamedResponse->setCallback(function () {
$spreadsheet = //create you spreadsheet here;
$writer = new Xlsx($spreadsheet);
$writer->save('php://output');
});
@damijanc
damijanc / diff
Created June 12, 2015 14:30
using unix system to make file diff
/**
* @brief Find the difference between two strings, lines assumed to be separated by "\n|
* @param $new string The new string
* @param $old string The old string
* @return string Human-readable output as produced by the Unix diff command,
* or "No changes" if the strings are the same.
* @throws Exception
*/
public function diff($new, $old)
{
@damijanc
damijanc / dabblet.css
Last active August 29, 2015 14:21 — forked from iamstarkov/dabblet.css
centering with absolute position
/**
* centering with absolute position
*/
div.header {
width: 100%;
background-color:green;
height: 30px;
position:relative;
}
div.container {