This file contains 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
# This is an example yaml config file for ESPHome to control Venetian blinds with one motor, where turning on the motor in 'up' direction first fully tilts open the blind then starts moving up, and vice versa, in 'down' direction first tilts blind closed, then starts moving down. | |
# AUTHOR: InToSSH - github.com/InToSSH | |
substitutions: | |
device_name: Living Room Cover | |
esphome: | |
name: living_room_blind | |
platform: ESP8266 | |
board: esp01_1m |
This file contains 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
protected function replaceBase64ImagesWithCid($content, Swift_Message $message) | |
{ | |
return preg_replace_callback( | |
"/(<img[^>]*src *= *[\"']?)([^\"']*)/i", | |
function ($matches) use ($message) { | |
$is_base64 = preg_match("/data:([a-z]+\/[a-z]+);base64,(.*)/i", $matches[2], $image_data); | |
if ($is_base64) { | |
$contentType = $image_data[1]; | |
list($type, $ext) = explode("/", $contentType); |
This file contains 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 | |
Builder::macro('orderByRelation', function(string $searchColumn, string $dir) { | |
list($relation, $column) = explode('.', $searchColumn); | |
$relation_table = $this->getRelation($relation)->getModel()->getTable(); | |
$relation_foreign_key = $this->getRelation($relation)->getForeignKeyName(); | |
$query_table = $this->getModel()->getTable(); | |
$this->select($query_table . '.*') | |
->join($relation_table, $query_table . '.' . $relation_foreign_key, '=', $relation_table . '.id') | |
->orderBy($relation_table . '.' . $column, $dir); |
This file contains 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
<template> | |
<div class="field"> | |
<label :for="id" :class="{'p-error':(v && v.$invalid && v.$dirty)}">{{ label }} {{ v && 'required' in v ? '*' : ''}}</label> | |
<AutoComplete | |
:model-value="modelItem" | |
@update:modelValue="(selected) => valueUpdated(selected)" | |
:suggestions="filteredItems" | |
@complete="searchItems($event)" | |
:dropdown="true" |