nano /etc/bind/named.conf.option
forwarders {
// Router DNS
192.168.2.1
// Google Public DNS
8.8.8.8;
8.8.4.4;
// OpenDNS
208.67.222.222;
208.67.220.220;
};
systemctl restart named
php artisan optimize:clear
function parseUrls(e) {
let domains = element.value.split('\n');
const re = /(?:[\w-]+\..)+[\w-]+/g;
element.value = "";
for (let i = 0, ln = domains.length; i < ln; ++i) {
element.value += re.exec(domains[i]) + '\n';
re.exec(domains[i]);
}
}
id
является сокращением от child::id
и будет извлекать узел элемента на дочерней оси. Для оси атрибутов нужно использовать attribute::id
или ярлык @id
.foreach ($xpath->evaluate('//genre') as $node) {
var_dump(
[
'parent_id' => $xpath->evaluate('string(ancestor::genre[1]/@id)', $node),
'id' => $node->getAttribute('id'),
'title' => $node->getAttribute('title'),
]
);
}
.exe.vmoptions
файлы из папки с конфигурацией PhpStorm:<button type="button" class="btn btn-outline-primary" data-toggle="modal" data-target="#modalVote">
Голосовать
</button>
<div class="modal fade" id="modalVote" tabindex="-1" aria-labelledby="modalVoteLabel" data-backdrop="true" aria-hidden="true" role="dialog">
<div class="modal-dialog modal-dialog-centered modal-xl" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="modalVoteLabel">Голосование</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
...
</div>
</div>
</div>
</div>
jQuery(function () {
jQuery("#modalVote").appendTo("body");
});
"autoload": {
...,
"files": [
"app/Helpers/functions.php"
]
},
"autoload": {
"psr-4": {
"App\\": "app/",
"Database\\Factories\\": "database/factories/",
"Database\\Seeders\\": "database/seeders/"
},
"files": [
"app/Helpers/functions.php"
]
},
<?php
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
function formattedDate($value) {
$date = new \DateTime($value);
$intlFormatter = new IntlDateFormatter('ru_RU', IntlDateFormatter::GREGORIAN, IntlDateFormatter::SHORT);
$intlFormatter->setPattern('d MMMM YYYY в HH:mm');
$formattedDate = $intlFormatter->format($date);
return $formattedDate;
}
$this->publishes([
__DIR__ . '/../public' => public_path('vendor/sone'),
], 'Sone-public');
"scripts": {
"post-install-cmd": [
"...",
"php artisan vendor:publish --tag=public --force"
],
"post-update-cmd": [
"...",
"php artisan vendor:publish --tag=public --force"
],
},
/**
* Update the specified resource in storage.
*
* @param \Illuminate\Http\Request $request
* @param \App\Models\Round $round
* @return \Illuminate\Http\Response
*/
public function update(Request $request, Round $round)
{
$request->validate([
'name' => 'required'
]);
$request->merge([
'status' => $request->has('status') ? true : false
]);
$round->update($request->all());
if($request->has('image')) {
$image = $request->file('image');
$extension = $image->extension();
$imageName = $image->getClientOriginalName();
$image->move(storage_path('app/public/images/battles/battle'.$request->battle_id.'/round'.$request->rnum), $imageName);
$round->image = $imageName;
}
$round->save();
return redirect()->back()
->with('success', 'Запись обновлена.');
}
cd C:\ProgramData\ComposerSetup\bin
php composer.phar
function updateURLParameter(url, param, paramVal){
var newAdditionalURL = "";
var tempArray = url.split("?");
var baseURL = tempArray[0];
var additionalURL = tempArray[1];
var temp = "";
if (additionalURL) {
tempArray = additionalURL.split("&");
for (var i=0; i<tempArray.length; i++){
if(tempArray[i].split('=')[0] != param){
newAdditionalURL += temp + tempArray[i];
temp = "&";
}
}
}
var rows_txt = temp + "" + param + "=" + paramVal;
return baseURL + "?" + newAdditionalURL + rows_txt;
}
function addParam(v) {
var newURL = updateURLParameter(window.location.href, 'locId', 'newLoc');
newURL = updateURLParameter(newURL, 'resId', 'newResId');
window.history.replaceState('', '', updateURLParameter(window.location.href, "t", v));
location.reload();
}
<a href="javascript:addParam('4');">...</a>
<a href="javascript:addParam('5');">...</a>
<script src="https://cdn.ckeditor.com/ckeditor5/21.0.0/balloon-block/ckeditor.js"></script>
<script src="https://cdn.ckeditor.com/ckeditor5/21.0.0/balloon-block/translations/ru.js"></script>
<script>
const textarea = document.querySelector( '#editor' );
BalloonEditor.create( textarea , {
language: 'ru',
removePlugins: [ 'Table' ],
toolbar: [ 'bold', 'italic', 'bulletedList', 'numberedList', 'blockQuote' ]
})
.then( editor => {
window.editor = editor;
editor.model.document.on( 'change:data', ( evt, data ) => {
console.log( data );
$('textarea#tickets-editor').html( editor.getData() );
} );
} )
.catch( error => {
console.error( 'There was a problem initializing the editor.', error );
} );
</script>
.then( editor => {...}
код добавить:.then( editor => {
window.editor = editor;
editor.model.document.on( 'change:data', ( evt, data ) => {
console.log( data );
$('textarea#tickets-editor').html( editor.getData() );
} );
} )
jQuery(document).ready(function($) {
$('.navbar-toggler').each(function () {
$(this).click(function() {
$('.navbar-toggler').toggleClass('active');
$('.bs-canvas-overlay').toggleClass('show');
$('.bs-canvas').toggleClass('active');;
return false;
})
});
jQuery(document).ready(function($) {
let bsDefaults = {
offset: false,
overlay: true,
width: '330px'
};
let bsMain = $('.bs-offset-main');
let bsOverlay = $('.bs-canvas-overlay');
$('.nav-link-collapse').on('click', function() {
$('.nav-link-collapse').not(this).removeClass('nav-link-show');
$(this).toggleClass('nav-link-show');
});
let documentMenu = {
isOpen: false,
hamburgerToggle: () => {
if (documentMenu.isOpen === false) {
$('.cmn-toggle-switch').addClass("active");
// documentMenu.open();
} else {
$('.cmn-toggle-switch').removeClass("active");
// documentMenu.close();
}
documentMenu.isOpen = !documentMenu.isOpen;
},
open: () => {
documentMenu.hamburgerToggle();
let canvas = $('[data-toggle="canvas"][aria-expanded="false"]').data('target'),
opts = $.extend({}, bsDefaults, $(canvas).data()),
prop = $(canvas).hasClass('bs-canvas-right') ? 'margin-right' : 'margin-left';
if (opts.width === '100%')
opts.offset = false;
$(canvas).css('width', opts.width);
if (opts.offset && bsMain.length)
bsMain.css(prop, opts.width);
$(canvas + ' .bs-canvas-close').attr('aria-expanded', "true");
$('[data-toggle="canvas"][data-target="' + canvas + '"]').attr('aria-expanded', "true");
if (opts.overlay && bsOverlay.length)
bsOverlay.addClass('show');
return false;
},
close: () => {
documentMenu.hamburgerToggle();
let canvas, aria;
let object = $('.bs-canvas-close, .bs-canvas-overlay');
if ($(object).hasClass('bs-canvas-close')) {
canvas = $(object).closest('.bs-canvas');
aria = $(object).add($('[data-toggle="canvas"][data-target="#' + canvas.attr('id') + '"]'));
if (bsMain.length)
bsMain.css(($(canvas).hasClass('bs-canvas-right') ? 'margin-right' : 'margin-left'), '');
} else {
canvas = $('.bs-canvas');
aria = $('.bs-canvas-close, [data-toggle="canvas"]');
if (bsMain.length)
bsMain.css({
'margin-left': '',
'margin-right': ''
});
}
canvas.css('width', '');
aria.attr('aria-expanded', "false");
if (bsOverlay.length)
bsOverlay.removeClass('show');
return false;
}
};
$('.cmn-toggle-switch').on('click', function(e){
e.preventDefault();
if (documentMenu.isOpen === false)
documentMenu.open();
else
documentMenu.close();
});
$('.bs-canvas-close, .bs-canvas-overlay').on('click', function() {
documentMenu.close();
});
});
package sample.controller;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.scene.control.Alert;
import javafx.scene.control.Alert.AlertType;
import java.net.URL;
import java.util.ResourceBundle;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.control.TableView;
import javafx.scene.control.cell.PropertyValueFactory;
import sample.model.Person;
import sample.model.ConnectDB;
import javafx.scene.control.TableColumn;
import java.sql.*;
public class Controller implements Initializable {
Connection conn = null;
ResultSet rs = null;
Statement st = null;
@FXML
private URL location;
@FXML
private ResourceBundle resources;
@FXML
private TableView<Person> tableUsers;
@FXML
private TableColumn<Person, Integer> idColumn;
@FXML
private TableColumn<Person, String> usernameColumn;
@FXML
private TableColumn<Person, String> firstnameColumn;
@FXML
private TableColumn<Person, String> lastnameColumn;
@FXML
private TableColumn<Person, String> emailColumn;
@FXML
private TableColumn<Person, String> genderColumn;
@FXML
private TableColumn<Person, String> descColumn;
@FXML
private TableColumn<Person, String> createdonColumn;
@FXML
private TableColumn<Person, String> editedonColumn;
@FXML
private TableColumn<Person, String> activeColumn;
@FXML
private void tableUsersCreate(ActionEvent event) {
Alert alert = new Alert(AlertType.CONFIRMATION);
alert.setTitle("Table refresh");
// alert.setHeaderText("Results:");
alert.setContentText("Refresh table to the database successfully!");
tableUsers.refresh();
alert.showAndWait();
}
@FXML
private void tableUsersUpdate(ActionEvent event) {
Alert alert = new Alert(AlertType.WARNING);
alert.setTitle("Table refresh");
// alert.setHeaderText("Results:");
alert.setContentText("Refresh table to the database successfully!");
tableUsers.refresh();
alert.showAndWait();
}
@FXML
private void tableUsersRefresh(ActionEvent event) {
Alert alert = new Alert(AlertType.INFORMATION);
alert.setTitle("Table refresh");
// alert.setHeaderText("Results:");
alert.setContentText("Refresh table to the database successfully!");
tableUsers.refresh();
alert.showAndWait();
}
@FXML
private void tableUsersDelete(ActionEvent event) {
Alert alert = new Alert(AlertType.ERROR);
alert.setTitle("Table refresh");
// alert.setHeaderText("Results:");
alert.setContentText("Refresh table to the database successfully!");
tableUsers.refresh();
alert.showAndWait();
}
@FXML
public void initialize(URL location, ResourceBundle resources) {
conn = ConnectDB.ConnectMariaDB();
final ObservableList data = FXCollections.observableArrayList();
String query = "SELECT * FROM test";
Statement st = null;
try {
st = conn.createStatement();
} catch (SQLException e) {
e.printStackTrace();
}
ResultSet rs = null;
try {
rs = st.executeQuery(query);
} catch (SQLException e) {
e.printStackTrace();
}
Person person;
try {
while (rs.next()) {
int id = rs.getInt("id");
String username = rs.getString("username");
String firstname = rs.getString("firstname");
String lastname = rs.getString("lastname");
String email = rs.getString("email");
String gender = rs.getString("gender");
String description = rs.getString("description");
String createdon = rs.getString("createdon");
String editedon = rs.getString("editedon");
boolean active = rs.getBoolean("active");
person = new Person(id,username,firstname,lastname,email,gender,description,createdon,editedon,active);
data.add(person);
}
st.close();
} catch(Exception e) {
System.out.println("There is an Exception.");
System.out.println(e.getMessage());
}
idColumn.setCellValueFactory(new PropertyValueFactory<>("id"));
usernameColumn.setCellValueFactory(new PropertyValueFactory<>("username"));
firstnameColumn.setCellValueFactory(new PropertyValueFactory<>("firstname"));
lastnameColumn.setCellValueFactory(new PropertyValueFactory<>("lastname"));
emailColumn.setCellValueFactory(new PropertyValueFactory<>("email"));
genderColumn.setCellValueFactory(new PropertyValueFactory<>("gender"));
descColumn.setCellValueFactory(new PropertyValueFactory<>("description"));
createdonColumn.setCellValueFactory(new PropertyValueFactory<>("createdon"));
editedonColumn.setCellValueFactory(new PropertyValueFactory<>("editedon"));
activeColumn.setCellValueFactory(new PropertyValueFactory<>("active"));
tableUsers.setItems(data);
}
}