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
/* учитывайте, что глобальный метод window.onerror | |
не будет ловить исключения без Vue.config.errorHandler */ | |
Vue.config.errorHandler = (error, vm, info) => { | |
return middlewareErrorHandler(error, info); | |
} | |
// сюда попадут все ошибки, которые находятся за пределами исполнения Vue | |
window.onerror = ( | |
message, |
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
/* middleware может принимать любое количество аргументов любых типов */ | |
const middleware = (...args) => { | |
const [event, ...data] = args; | |
if (event.error) { | |
/* поймали объект экземпляр Error */ | |
return event.error; | |
} | |
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
#!/bin/sh | |
branch=$1 | |
if [ ! -z "$1" ] | |
then | |
git branch -D $branch | |
git push -d origin $branch | |
else | |
echo "Branch name is not specified" |
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
sudo apt-get install python-software-properties -y | |
sudo add-apt-repository ppa:ondrej/php -y | |
sudo apt-get update -y | |
sudo apt-get install php7.2 php-pear php7.2-curl php7.2-dev php7.2-gd php7.2-mbstring php7.2-zip php7.2-mysql php7.2-xml | |
sudo apt-get install libapache2-mod-php7.2 -y | |
sudo a2dismod php5 | |
sudo a2enmod php7.2 | |
sudo service apache2 restart |
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
/** | |
* Retrieves all the rows in the active spreadsheet that contain data and logs the | |
* values for each row. | |
* For more information on using the Spreadsheet API, see | |
* https://developers.google.com/apps-script/service_spreadsheet | |
*/ | |
function readRows() { | |
var sheet = SpreadsheetApp.getActiveSheet(); | |
var rows = sheet.getDataRange(); | |
var numRows = rows.getNumRows(); |
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
/** | |
* Retrieves all the rows in the active spreadsheet that contain data and logs the | |
* values for each row. | |
* For more information on using the Spreadsheet API, see | |
* https://developers.google.com/apps-script/service_spreadsheet | |
*/ | |
function readRows() { | |
var sheet = SpreadsheetApp.getActiveSheet(); | |
var rows = sheet.getDataRange(); | |
var numRows = rows.getNumRows(); |
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 | |
if ($_SERVER["REQUEST_METHOD"] == "POST") { | |
if (!empty($_POST['name']) && !empty($_POST['phone'])){ | |
if (isset($_POST['name'])) { | |
if (!empty($_POST['name'])){ | |
$uname = strip_tags($_POST['name']); | |
$unameFieldset = "Имя:%20"; | |
} | |
} | |
if (isset($_POST['phone'])) { |
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
<form enctype="multipart/form-data" method="post"> | |
<b>Файл для отправки:</b> | |
<input type="file" name="document"> | |
<input type="hidden" name="MAX_FILE_SIZE" value="50000000" /> | |
<input type="submit" value="Отправить"> | |
</form> | |
<?php //Send file Telegram | |
$caption = "Caption for file"; | |
$url = "https://api.telegram.org/botToken/sendDocument"; |
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
// store/index.js | |
const createStore = () => { | |
return new Vuex.Store({ | |
state: { | |
counter: 0, | |
repos: [] | |
}, | |
actions: { | |
LOAD_REPOS: function({ commit }) { | |
axios.get('url').then((res) => { |