This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select index_schema, | |
index_name, | |
group_concat(column_name order by seq_in_index) as index_columns, | |
index_type, | |
case non_unique | |
when 1 then 'Not Unique' | |
else 'Unique' | |
end as is_unique, | |
table_name | |
from information_schema.statistics |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Setup links | |
media-ctl -l "'ov2680 1-0036':0 -> 'imx7-mipi-csis.0':0[1]" | |
media-ctl -l "'imx7-mipi-csis.0':1 -> 'csi_mux':1[1]" | |
media-ctl -l "'csi_mux':2 -> 'csi':0[1]" | |
media-ctl -l "'csi':1 -> 'csi capture':0[1]" | |
# Configure pads for pipeline | |
media-ctl -V "'ov2680 1-0036':0 [fmt:SBGGR10_1X10/800x600 field:none]" | |
media-ctl -V "'csi_mux':1 [fmt:SBGGR10_1X10/800x600 field:none]" | |
media-ctl -V "'csi_mux':2 [fmt:SBGGR10_1X10/800x600 field:none]" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import glob | |
import csv | |
import sys | |
from multiprocessing import Pool, freeze_support | |
from xlsxwriter.workbook import Workbook | |
def process_csv_to_xlsx(csvfile): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Custom\Support; | |
use \Illuminate\Support\ServiceProvider; | |
class SessionRejectServiceProvider extends ServiceProvider { | |
public function register() | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
WITH RECURSIVE materials_list as ( | |
SELECT | |
1 as n, | |
produces_names.typeID as produces_id, | |
produces_names.typeName as produces_name, | |
materials.quantity as produces_qty, | |
materials.materialTypeID as material_id, | |
materials.quantity as material_qty, | |
material_names.typeName as material_name | |
FROM invTypeMaterials as materials |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once './vendor/autoload.php'; | |
/** @todo read straight from the crontab file */ | |
$jobs = [ | |
'task1' => [ | |
'0 6 * * *' => (new \Cron\CronExpression('0 6 * * *')), | |
'45 7 * * *' => (new \Cron\CronExpression('45 7 * * *')), | |
'15 8 * * *' => (new \Cron\CronExpression('15 8 * * *')), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Splits $str into chunks preferring $min until the end chunk. | |
* If the remaining chars will fit in a max chunk then max is used. | |
* @param string $str | |
* @param integer $min | |
* @param integer $max | |
*/ | |
public function str_chunk_min_max($str, $min=1, $max=1) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function getParamSplitBy($param, $delimiter='~', $subDelimiter=':') | |
{ | |
$paramChunks = array_chunk(preg_split('/('.$delimiter.'|'.$subDelimiter.')/', urldecode($this->getParam($param))), 2); | |
$keys = array_column($paramChunks, 0); | |
$unpaddedValues = array_column($paramChunks, 1); | |
$keyCount = count($keys); | |
$unpaddedCount = count($unpaddedValues); | |
$values = ($keyCount > count($unpaddedCount)) ? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function parseSize($size) | |
{ | |
$unit = preg_replace('/[^bkmgtpezy]/i', '', $size); // Remove the non-unit characters from the size. | |
$size = preg_replace('/[^0-9\.]/', '', $size); // Remove the non-numeric characters from the size. | |
if ($unit) { | |
// Find the position of the unit in the ordered string which is the power of magnitude to multiply a kilobyte by. | |
return $bytesSize = $size * pow(1024, stripos('bkmgtpezy', $unit[0])); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Start service | |
sudo systemctl start docker | |
# Build | |
sudo docker build -t php5-test . | |
# Run | |
sudo docker run -itd --entrypoint /bin/sh --name php5-test-app php5-test | |
# Run with strace available |