Skip to content

Instantly share code, notes, and snippets.

View am-monkey's full-sized avatar

Ilya Afanasov am-monkey

View GitHub Profile
@am-monkey
am-monkey / migrate.sh
Created April 13, 2024 16:46 — forked from Geczy/readme.md
Migrate Coolify to a new server
#!/bin/bash
# This script will backup your Coolify instance and move everything to a new server. Docker volumes, Coolify database, and ssh keys
# 1. Script must run on the source server
# 2. Have all the containers running that you want to migrate
# Configuration - Modify as needed
sshKeyPath="$HOME/.ssh/your_private_key" # Key to destination server
destinationHost="server.example.com"
@am-monkey
am-monkey / docker_wordpress.md
Created October 2, 2021 10:02 — forked from bradtraversy/docker_wordpress.md
Docker Compose FIle For Wordpress, MySQL & phpmyadmin

Wordpress & Docker

This file will setup Wordpress, MySQL & PHPMyAdmin with a single command. Add the code below to a file called "docker-compose.yaml" and run the command

$ docker-compose up -d

# To Tear Down
$ docker-compose down --volumes
// создаем div
var element = document.createElement("div");
// обновляем у него класс
element.classList.add("box");
// задаем ему внутри текст
element.textContent = "Text inside box";
// встраиваем получившийся элемент в .container
// Создать div и добавить его в элемент .container
$(".container").append($("<div/>"));
// Создать div и добавить его в элемент .container
var element = document.createElement("div");
document.querySelector(".container").appendChild(element);
// jQuery
// Обновить текст элемента .button
$(".button").text("New text");
// Прочитать и вывести текст элемента .button
$(".button").text(); // Возвращает "New text"
// Без jQuery
// Обновить текст элемента .button
document.querySelector(".button").textContent = "New text";
// Прочитать и вывести текст элемента .button
var element = document.createElement("div");
element.textContent = "Text"
// или создаем сначала строку с текстом и вставляем после
var text = document.createTextNode("Text");
element.appendChild(text);
// Создаем div и span
$("<div/>");
$("<span/>");
// Создаем div и span
document.createElement("div");
document.createElement("span");
// jQuery
$.ajax({
url: "data.json"
}).done(function(data) {
// работаем с данными
}).fail(function() {
// обрабатываем ошибку
});
// Без jQuery
// jQuery
// Проверяем, если у элемента с классом .box есть класс "focus" и что-то выполняем
if ($(".box").hasClass("focus")) {
// здесь пишем код, для случая когда условие выполнилось
}
// Без jQuery
// Проверяем, если у элемента с классом .box есть класс "focus" и что-то выполняем
if (document.querySelector(".box").classList.contains("focus")) {
// здесь пишем код, для случая когда условие выполнилось
// Удаляем класс "focus" и ставим вместо него "blurred"
document.querySelector(".box").classList.replace("focus", "blurred");