Skip to content

Instantly share code, notes, and snippets.

@blackfyre
blackfyre / GeneralModal.vue
Last active November 14, 2023 04:45
Modals in Laravel Nova Tools
<template>
<modal @modal-close="handleClose">
<form
@submit.prevent="handleConfirm"
slot-scope="props"
class="bg-white rounded-lg shadow-lg overflow-hidden"
style="width: 460px"
>
<slot :uppercaseMode="uppercaseMode" :mode="mode">
<div class="p-8">
var that = this;
this.myForm = this.FormBuilder.group({
username: ["", this.Validators.required],
password: ["", this.Validators.required],
bio: ["", this.Validators.required],
});
this.create = function() {
console.log("VALUES", that.myForm.valid, that.myForm.value);
Установить Docker CE и docker-compose на систему, если у вас MacOS или Windows
вы можете скачать установщик с офф. сайта
https://www.docker.com/get-started
Если же у вас Linux проводим установку как указано здесь:
https://docs.docker.com/install/linux/docker-ce/ubuntu/#install-docker-ce
Далее устанавливаем docker-compose
https://www.digitalocean.com/community/tutorials/how-to-install-docker-compose-on-ubuntu-16-04
@tpunt
tpunt / doc.md
Last active October 8, 2018 06:57
PHP 7.2 Migration Guide ToDo's

Incompatibilities:

  • Session:
    • Removed register_globals related code and "!" can be used as $_SESSION key name.
    • Session is made to manage session status correctly and prevents invalid operations. Only inappropriate codes are affected by this change. If you have problems with this, it means you have problem in your code.
      • Functions are made to set or return correct session status. session_start(), session_status(), session_regenerate_id()
  • Functions are made to return bool from null. These functions have void parameter
@tomasevich
tomasevich / nginx_nodejs.md
Last active April 7, 2024 12:13
Сервер в связке Nginx + NodeJs

Сервер в связке Nginx + NodeJs

Данная пошаговая инструкция поможет освоить основы на простом примере

Для справки

Сервер поднимался на Debian 8 c характеристиками:

CPU - 1 ядро x 500 МГц

@micc83
micc83 / mysqldump.php
Created June 5, 2017 13:17
Simple PHP script to dump a MySql database
<?php
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
$database = 'db';
$user = 'user';
$pass = 'pass';
$host = 'localhost';
// http://stackoverflow.com/a/5727346/3774582
// Parse CRON frequency
// Break it down like James Brown
function parse_crontab($time, $crontab) {
// Get current minute, hour, day, month, weekday
$time = explode(' ', date('i G j n w', strtotime($time)));
// Split crontab by space
$crontab = explode(' ', $crontab);
// Foreach part of crontab
foreach ($crontab as $k => &$v) {
@mattiaslundberg
mattiaslundberg / Ansible Let's Encrypt Nginx setup
Last active April 19, 2024 16:03
Let's Encrypt Nginx setup with Ansible
Ansible playbook to setup HTTPS using Let's encrypt on nginx.
The Ansible playbook installs everything needed to serve static files from a nginx server over HTTPS.
The server pass A rating on [SSL Labs](https://www.ssllabs.com/).
To use:
1. Install [Ansible](https://www.ansible.com/)
2. Setup an Ubuntu 16.04 server accessible over ssh
3. Create `/etc/ansible/hosts` according to template below and change example.com to your domain
4. Copy the rest of the files to an empty directory (`playbook.yml` in the root of that folder and the rest in the `templates` subfolder)
@prappo
prappo / .env
Created August 21, 2016 10:22
env file for Laravel postgresql database
APP_ENV=local
APP_DEBUG=true
APP_KEY=base64:hyHUpukUUigKeEsxpGeTW4UZ+Lg+WAWxcc4/BjlgNtE=
APP_URL=http://localhost
DB_CONNECTION=pgsql
DB_HOST=hostname
DB_PORT=5432
DB_DATABASE=Your database name
DB_USERNAME=Your database username
@cecilemuller
cecilemuller / letsencrypt_2020.md
Last active April 15, 2024 02:19
How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SSL rating)

How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SLL rating)


Virtual hosts

Let's say you want to host domains first.com and second.com.

Create folders for their files: