Skip to content

Instantly share code, notes, and snippets.

View mysiar's full-sized avatar
🌐
Working remotely

Piotr Synowiec mysiar

🌐
Working remotely
View GitHub Profile
@mysiar
mysiar / ideolog-monolog.md
Created February 22, 2019 18:15
Monolog template for Ideolog
Message pattern: `^\[(.*)\] (.+?)\.([A-Z]+): (.*)`
Message start pattern: `^\[`
Time format: `yyyy-MM-dd HH:mm:ss`
Time capture group: `1`
Severity capture group: `3`
Category capture group: `2`
@mysiar
mysiar / garmin-iq-sdk-ubuntu-18.04.md
Last active March 26, 2022 11:11
Garmin IQ SDK on Ubuntu 18.04
@mysiar
mysiar / replaceElementNodeValue.js
Created November 14, 2018 17:53
replaceElementNodeValue
/*
replaceElementNodeValue
this function works if only ONE element with nodeClass is found
element - DOM element with nested different elements
nodeClass - class of node that value we want to replace
nodeNewValue - selfexplaining
*/
@mysiar
mysiar / Api-Platform_and_ DataTable.md
Created October 1, 2018 20:11
Api-Platform - DataTable

api-platform/api-platform#845 (comment)

Just to let you know: it seems the easiest way was to reorder the JSON response on the client side, using the dataFilter setting in jQuery.ajax():

$('#mytable').DataTable({
        'serverSide': true,
        'ajax': {
            'url': '/api/my_api',
            'headers': { 'Accept': "application/ld+json" },
 'dataFilter' : function (data) {
@mysiar
mysiar / refind_linux_windows.bat
Last active May 4, 2018 17:35
rEFInd linux windows
REM run on windows as admin
REM source https://superuser.com/questions/1298510/how-can-i-prevent-windows-8-1-overwriting-my-bootloader?utm_medium=organic&utm_source=google_rich_qa&utm_campaign=google_rich_qa
bcdedit /set {bootmgr} path \EFI\refind\refind_x64.efi
bcdedit /set {bootmgr} description REFIND
@mysiar
mysiar / InstallPostman.sh
Created April 28, 2018 10:43
Install Postman
sudo rm -rf /opt/Postman
wget https://dl.pstmn.io/download/latest/linux64 -O postman.tar.gz
sudo tar -xzf postman.tar.gz -C /opt
rm postman.tar.gz
sudo ln -s /opt/Postman/Postman /usr/bin/postman
cat > ~/.local/share/applications/postman.desktop <<EOL
[Desktop Entry]
Encoding=UTF-8
Name=Postman
@mysiar
mysiar / diffArrayCollection.php
Last active April 1, 2018 18:44
Comparing two ArrayCollections
<?php
/**
* Diff of two Object Collections
*
* @param Collection $collection1
* @param Collection $collection2
* @param string[] $fieldsToOmit - fields to omit from comparison
* @return Collection|ArrayCollection
*/
@mysiar
mysiar / symfony_4_xml_services.xml
Created February 23, 2018 12:42
Symfony 4 Service XML defintions
<services>
<!--REPOSITORY-->
<service id="test.provider_low_level_config_repository" class="mysiar\AppBundle\Repository\ConfigRepository">
<factory service="doctrine.orm.entity_manager" method="getRepository" />
<argument type="string">mysiar\AppBundle\Entity\Config</argument>
</service>
</services>
@mysiar
mysiar / Symfony_PostGIS.md
Last active January 24, 2018 07:58
Symfony PostGIS

Symfony & PostGIS

#app/config/config.yml
...
doctrine:
    dbal:
        ...
        types:
 geography: 'Jsor\Doctrine\PostGIS\Types\GeographyType'
@mysiar
mysiar / OSX-Kodi-Netflix.md
Created January 12, 2018 13:01
OSX Netflix on Kodi