Skip to content

Instantly share code, notes, and snippets.

@mpalourdio
mpalourdio / Proxy.php
Last active February 17, 2016 16:52
handling composite keys
<?php
/*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
@mpalourdio
mpalourdio / php-cs-fixer
Created November 12, 2014 21:24
@fabpot php-cs-fixer config for PhpStorm
parameters
--level=psr2 --verbose fix $FileDir$/$FileName$
working directory
$ProjectFileDir$
@mpalourdio
mpalourdio / github.sh
Last active February 3, 2025 14:45
Rewrite GIT history with a new email address
#!/bin/sh
git filter-branch --env-filter '
OLD_EMAIL="[email protected]"
CORRECT_NAME="Your Correct Name"
CORRECT_EMAIL="[email protected]"
if [ "$GIT_COMMITTER_EMAIL" = "$OLD_EMAIL" ]
then
@mpalourdio
mpalourdio / gist:790c2604e244dc934612
Last active February 19, 2025 12:19
GIT - convert lightweight tag to annotated tag
git checkout lightweight
git tag -d lightweight
GIT_COMMITTER_DATE="$(git show --format=%aD | head -1)" git tag annotated -m 'lightweight to annotated'
git push origin :refs/tags/lightweight
git push --tags
git config --global alias.plog "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"
@mpalourdio
mpalourdio / app.component.html
Last active February 3, 2025 14:50
ng-http-loader - Custom component
<router-outlet></router-outlet>
<ng-http-loader [entryComponent]="awesomeComponent" ></ng-http-loader>
@mpalourdio
mpalourdio / app.component.html
Last active February 3, 2025 14:49
ng-http-loader - Angular Material Integration example
<router-outlet></router-outlet>
<ng-http-loader [entryComponent]="matSpinner"></ng-http-loader>

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@mpalourdio
mpalourdio / clearpihole
Created May 14, 2022 08:10
clear pihole history
#!/bin/bash
set -x
service pihole-FTL stop
rm /etc/pihole/pihole-FTL.db
rm /var/log/pihole*
service pihole-FTL start
@mpalourdio
mpalourdio / autostart.sh
Last active May 21, 2022 10:25 — forked from ohnotnow/autostart.sh
Disabling wifi power management on rpi3/libreelec
# from : https://forum.libreelec.tv/thread/5074-wifi-issues-on-rpi-3-poor-speed-and-latency-solution/#codeLine_1_3e8919
# first install the 'network tools' add-on from the kodi repository then create a /storage/.config/autostart.sh file with
# this as the contents.
# then reboot the pi. runnning 'iwconfig' should now show the power-management as being off.
# mpalourdio : in LE 9+, iw is already installed at /usr/sbin/iw
# just create an autostart.sh and add :
/usr/sbin/iw wlan0 set power_save off