Skip to content

Instantly share code, notes, and snippets.

View eklect's full-sized avatar

Tony Mucci eklect

View GitHub Profile
@eklect
eklect / x.sql
Created June 21, 2024 17:18
Mysql → Remove non-digit characters from string in select statement
#This is for MySQL 8+ and MariaDB 10.0.5+
select REGEXP_REPLACE(COLUMN_NAME_HERE,'\\D','') from TABLE_NAME_HERE;
@eklect
eklect / x.php
Last active July 30, 2022 18:25
Phinx -> Getting Config name from Phinx Object.
<?php
$object = $this->getInput();
$ref = new ReflectionClass();
$prop = $ref->getProperty('options');
$prop->setAccessible(true);
$config_name = $prop->getValue($this->getInput())["configuration"];
@eklect
eklect / x.php
Created June 7, 2022 15:07
List of US STATES in PHP Assoc. Array
<?php
$states = [
'AL'=>'ALABAMA',
'AK'=>'ALASKA',
'AS'=>'AMERICAN SAMOA',
'AZ'=>'ARIZONA',
'AR'=>'ARKANSAS',
'CA'=>'CALIFORNIA',
'CO'=>'COLORADO',
@eklect
eklect / x.vue
Created January 15, 2022 18:43
Vuetify → Address Template
<v-row>
<v-col>
<h3 class="my-5">Contact Information</h3>
</v-col>
</v-row>
<v-row>
<v-col>
<v-text-field
v-model="firstName"
label="Enter First Name"
@eklect
eklect / ffmpeg-webm-to-mp4.sh
Created October 17, 2021 01:38
FFMPG → How to convert Webm to Mp4
#This isnt the greatest quality, but it works for a quick screen grab for Slack
ffmpeg -i input.webm -strict experimental output.mp4
@eklect
eklect / x.php
Created August 17, 2021 15:53
PHP → To Test throwing a 500 error
<?php
header("HTTP/1.0 500 Internal Server Error");
http_response_code(500);
@eklect
eklect / x.log
Created May 14, 2021 17:42
Mysql | Docker → Can't start Container because of Boot Server Version Error - Example 1
2021-05-14 17:20:38+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.23-1debian10 started.
2021-05-14 17:20:38+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
2021-05-14 17:20:38+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.23-1debian10 started.
2021-05-14T17:20:38.625575Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.23) starting as process 1
2021-05-14T17:20:38.638508Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2021-05-14T17:20:40.791471Z 1 [ERROR] [MY-013171] [InnoDB] Cannot boot server version 80023 on data directory built by version 80025. Downgrade is not supported
mysqld: Can't open file: 'mysql.ibd' (errno: 0 - )
2021-05-14T17:20:45.773352Z 1 [ERROR] [MY-010334] [Server] Failed to initialize DD Storage Engine
2021-05-14T17:20:45.774076Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed.
2021-05-14T17:20:45.774583Z 0 [ERROR] [MY-010119] [Server] Aborting
@eklect
eklect / x.sh
Created May 7, 2021 23:24
Linux → Move all files and directories, including hidden files
mv /sourceDir/{.,}* /destinationDir/
@eklect
eklect / x.mysql
Created March 22, 2021 15:42
MySQL → How to get/list tables of a database from Information Schema table
SELECT TABLE_NAME
FROM `INFORMATION_SCHEMA`.`tables`
where table_schema='YOUR_DATABASE_NAME_HERE';
@eklect
eklect / x.sh
Last active March 20, 2021 00:39
Linux → Kill a process by an ID that is found by a keyword in its command
ps -ax | grep PROCESS_NAME_HERE | grep KEYWORD_HERE | awk '{print $1}' | xargs kill -9
#Example
# ps -ax | grep php | grep importData | awk '{print $1}' | xargs kill -9