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
{% set contents = {"one": 1,"two":2,"three":3,"four":4,"five":5} %} | |
{# Create the array an structure somewhere in the view #} | |
{% set twigArray = {} %} | |
{% for content in contents %} | |
{% set twigArray = twigArray|merge({('hashkey_'~loop.index0):{'enabled':true,'caption':'unknow','button':{'text':'unknow','href':'unknow'},'image':{'src': content.content|raw),'alt':"image-"~loop.index, 'href':"" }}}) %} | |
{% endfor %} | |
{{ dump(twigArray)}} | |
{# For any reason you need to update a specific key value in the exiting array in the view | |
call the twig extension to do that in php side #} |
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
/* Command strings */ | |
#define GET_CAN_EXPAND "raspi-config nonint get_can_expand" | |
#define EXPAND_FS "raspi-config nonint do_expand_rootfs" | |
#define GET_HOSTNAME "raspi-config nonint get_hostname" | |
#define SET_HOSTNAME "raspi-config nonint do_hostname %s" | |
#define GET_BOOT_CLI "raspi-config nonint get_boot_cli" | |
#define GET_AUTOLOGIN "raspi-config nonint get_autologin" | |
#define SET_BOOT_CLI "raspi-config nonint do_boot_behaviour B1" | |
#define SET_BOOT_CLIA "raspi-config nonint do_boot_behaviour B2" | |
#define SET_BOOT_GUI "raspi-config nonint do_boot_behaviour B3" |
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
#include "DFRobot_ESP_EC.h" //https://github.com/GreenPonik/DFRobot_ESP_EC_BY_GREENPONIK.git | |
#include "DFRobot_ESP_PH_WITH_ADC.h" //https://github.com/GreenPonik/DFRobot_ESP_PH_WITH_ADC_BY_GREENPONIK.git | |
#include "Adafruit_ADS1015.h" //https://github.com/GreenPonik/Adafruit_ADS1X15.git | |
#include "OneWire.h" | |
#include "DallasTemperature.h" | |
#include "EEPROM.h" | |
#define ONE_WIRE_BUS 15 | |
OneWire oneWire(ONE_WIRE_BUS); |
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
#include "Arduino.h" | |
#include "DFRobot_ESP_EC.h" //https://github.com/GreenPonik/DFRobot_ESP_EC_BY_GREENPONIK.git | |
#include "DFRobot_ESP_PH_WITH_ADC.h" //https://github.com/GreenPonik/DFRobot_ESP_PH_WITH_ADC_BY_GREENPONIK.git | |
#include "Adafruit_ADS1015.h" //https://github.com/GreenPonik/Adafruit_ADS1X15.git | |
#include "OneWire.h" | |
#include "DallasTemperature.h" | |
#include "EEPROM.h" |
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
AsyncWebServer server_http(80); | |
const char header_html[] PROGMEM = "<!DOCTYPE html><html><head><meta http-equiv='Content-Type' content='text/html; charset=utf-8'/><meta name='viewport' content='width=device-width, initial-scale=1, minimum-scale=1.0, shrink-to-fit=no'><title>GreenPonik.com - WebView</title></head><body>"; | |
const char footer_html[] PROGMEM = "</body></html>"; | |
const char update_html[] PROGMEM = "<h1>Only .bin file</h1><form method='POST' action='/updt' enctype='multipart/form-data'><input type='file' name='update' required><input type='submit' value='Run Update'></form>"; | |
void setup() | |
{ | |
/* ... */ |
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
#include "Arduino.h" | |
#include "WiFi.h" | |
#include "ESPAsyncWebServer.h" | |
#include "SPIFFS.h" | |
const char *ssid = "<yourssid>"; | |
const char *password = "<wpakey>"; | |
AsyncWebServer server_http(80); |
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
<!DOCTYPE html> | |
<html> | |
<head></head> | |
<body> | |
<!-- //... --> | |
{% set cookieData = { | |
msg: 'this website using cookie and by continuing navigation you accept blablablabla....etc', | |
btn1: 'More', | |
btn2: 'Accept', | |
path: '/privacy-policy' |
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 App\Controller\Ui\WebSite; | |
use App\Services\SendinblueApi; | |
use Psr\Log\LoggerInterface; | |
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; | |
use Symfony\Component\HttpFoundation\Response; | |
use App\Form\ContactType; | |
use ReCaptcha\ReCaptcha; |
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 App\Services; | |
use Symfony\Component\DependencyInjection\ContainerInterface; | |
/** | |
* Class SendinblueApi | |
* | |
* @package App\Services |
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 React, { Component } from "react"; | |
import "./App.css"; | |
import MyTimer from "./MyTimer"; | |
class App extends Component { | |
render() { | |
return ( | |
<div className="App"> | |
<header className=""> |
NewerOlder