Skip to content

Instantly share code, notes, and snippets.

tail -f -v logdir/*.log | sed -E 's/([^\n]#[0-9]+\s)/\n\1/g'
export PHP_IDE_CONFIG=\"serverName=${phpstorm_server_config_name}\" && \
php \
-dxdebug.remote_host=${xdebug_remote_host} \
-dxdebug.remote_port=${xdebug_remote_port} \
-dxdebug.idekey=${xdebug_idekey} \
-dxdebug.remote_enable=${xdebug_remote_enable} \
-dxdebug.remote_mode=${xdebug_remote_mode} \
-dxdebug.remote_autostart=${xdebug_remote_autostart} \
-dxdebug.remote_connect_back=${xdebug_remote_connect_back} \
-dxdebug.remote_log=${xdebug_remote_log} \
@AntonioCS
AntonioCS / bcmake.bat
Last active November 22, 2020 07:56
Small bat file to create basic project. Will create src/ dir if not present (with dummy code). Will create tests/ folder if not present (with dummy test code). Will create build/ folder (if present with a .sln file ask if you want to delete). Check if there is a CMakeLists.txt and if there isn't create a generic one.
@echo off
@setlocal EnableExtensions EnableDelayedExpansion
:: This batch file will try to generate a minimalist project
:: It will create a src folder with a small cpp file^
:: It will create a test folder with some mock test files for catch2/catch
:: It will also ask if you want to enable testing
:: If a solution already exists (in the build folder) it will ask if you want to remove it and rebuild
:: NOTE: Run this in admin mode if it doesn't work
inotifywait -m -r /myfolder -e create -e moved_to -e modify -e delete |
while read path action file; do
echo "The file '$file' appeared in directory '$path' via '$action'"
done
@AntonioCS
AntonioCS / create_table
Created November 5, 2020 14:25
Basic create table
CREATE TABLE `<table_name>` (
`id` INT(11) NOT NULL AUTO_INCREMENT,
`created_at` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`is_deleted` TINYINT(4) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`) USING BTREE
)
COLLATE='utf8mb4_general_ci'
ENGINE=InnoDB
;
@AntonioCS
AntonioCS / parameters.inc.dist
Created November 9, 2020 23:28
This is to be used in the Makefile
###### DO NOT EDIT THIS FILE
###### Use "make params" to create parameters.inc and do the changes there.
###### If you want to simply add something just do: var_name += new_data
###### Or if you want to overwrite you can just do: var_name = data
#Mysql data for logging
mysql_user=
#Only put the password in dev environment (if there is no password it will be asked)
mysql_pass=
mysql_log_file=//application/mysql_query.log
@AntonioCS
AntonioCS / install_docker_and_docker_compose_linux.sh
Last active November 16, 2021 13:54
Install docker and docker-compose on linux host
#!/bin/bash
#RUN THIS SCRIPT AS ROOT
#https://docs.docker.com/engine/install/ubuntu/
apt-get remove docker docker-engine docker.io containerd runc
apt-get update
apt-get -y install \
apt-transport-https \
ca-certificates \
curl \
@AntonioCS
AntonioCS / ds3_load_sl_133_backup_and_run_game.bat
Created November 13, 2020 23:53
A basic bat to load a Dark Souls 3 save file and then run DarkSouls 3
@echo off
set DS3_MAIN_PROGRAM=C:\\Program Files (x86)\\Steam\\steamapps\\common\\DARK SOULS III\\Game\\DarkSoulsIII.exe
set DS3_save_dir=%appdata%\DarkSoulsIII\\<YOUR_STEAM_ID>
set DS3_backups_dir=<DIRECTORY_OF_THE_SAVE_FILE>
set DS3_original_filename=DS30000.sl2
set DS3_backup_filename=<NAME_OF_BACKUP_FILE_TO_LOAD_NAME>
copy "%DS3_backups_dir%\\%DS3_backup_filename%" "%DS3_save_dir%\\%DS3_original_filename%"
@AntonioCS
AntonioCS / backup_darksouls3.bat
Created November 14, 2020 00:00
Create a backup of the DS3 save file in the format DS30000.sl2_YEAR-MONTH-DAY_(hh-mm-ss)
@echo off
for /f "delims=" %%a in ('wmic OS Get localdatetime ^| find "."') do set DateTime=%%a
set Yr=%DateTime:~0,4%
set Mon=%DateTime:~4,2%
set Day=%DateTime:~6,2%
set Hr=%DateTime:~8,2%
set Min=%DateTime:~10,2%
set Sec=%DateTime:~12,2%
@echo off
REM Run this in Developer Command Prompt
REM https://docs.microsoft.com/en-us/cpp/build/reference/compiler-options-listed-alphabetically?view=msvc-160
set file=%1
cl %file% /std:c++17 /EHsc