Skip to content

Instantly share code, notes, and snippets.


João Silva Xplouder

View GitHub Profile
Xplouder /
Last active May 16, 2019
PHP - Rewrite dependencies classes

Class Alias


namespace Shop\Models;

use Shop\Models\Address as AddressClass;

/** @var Address parent */
class_alias(defined('AddressClass') ? AddressClass : Address::class, 'ThingPink\Shop\Models\AddressClass');
Xplouder /
Last active Feb 24, 2021
Elasticsearch Logs Handbook

Fetch documents with timetamp lower than the defined date (curl format)

curl --request GET \
  --url http://localhost:9200/_search \
  --header 'Content-Type: application/json' \
  --header 'cache-control: no-cache' \
  --data '{\n  "query": {\n    "bool": {\n      "filter": {\n        "range": {\n          "@timestamp": {\n            "lt": "2019-01-01"\n          }\n        }\n      }\n    }\n  }\n}'

Keybase proof

I hereby claim:

  • I am xplouder on github.
  • I am xplouder ( on keybase.
  • I have a public key ASBzqnWkbkmQNiYH7tUwPs4CA-BN3QmyVzXns731BQjLSQo

To claim this, I am signing this object:

Xplouder /
Created Dec 21, 2018
FIX: Linux suspend interrupt with ACPI wakeup

For Ubuntu 15+, you must use systemd instead of rc.local. You may google "Creating a systemd service" and follow the instructions, but note that redirecting output to /proc/acpi/wakeup is tricky. To get it to work correctly, you must do something like:

/bin/sh -c '/bin/echo XHC > /proc/acpi/wakeup'

Example output for the service file (e.g., /etc/systemd/system/suspendfix.service):

Description=fix to prevent system from waking immediately after suspend

rename entire folder content to ordered filenames

ls | cat -n | while read n f; do mv "$f" "optional_prefix$n.jpg"; done

remove files with odd numbers in the name ending

ls | grep -P '[02468]\.\w*$' | xargs -d "\n" rm

revert the order of ordered filenames

for i in {1..50}; do mv "$i.jpg" "renamed/shirt_$(( 50 - $i + 1 )).jpg"; done

remove some text recursively from you current directory

Xplouder / Linux Mint terminal on steroids!
Last active Jul 2, 2016
Linux Mint terminal on steroids!
View Linux Mint terminal on steroids!
1) > sudo apt-get install zsh
2) > chsh -s $(which zsh)
2) > sh -c "$(wget -O -)"
3) configurate themes and plugins
4) > wget
> mkdir -p ~/.fonts/ && mv PowerlineSymbols.otf ~/.fonts/
> fc-cache -vf ~/.fonts
> mkdir -p ~/.config/fontconfig/conf.d/ && mv 10-powerline-symbols.conf ~/.config/fontconfig/conf.d/
5) logout & login / reboot
6) Optionally set DEFAULT_USER in ~/.zshrc to your regular username to hide the “user@hostname” info when you’re logged in as yourself on your local machine.
View Create Heroku App (Laravel)
1) Create a new laravel instalation
-> composer create-project laravel/laravel
Or just use an existing project
2) Create a file named Procfile (without extension) in root laravel folder
2.1) Add this line:
-> web: vendor/bin/heroku-php-apache2 public
3) Install Heroku Toolbelt
View gist:b33ca9bc7de5653330b0
PROCEDURE main (p_initialize BOOLEAN);
PROCEDURE read_file(p_dir VARCHAR2, p_file_name VARCHAR2);
END pck_extract;
create or replace PACKAGE BODY pck_extract IS