Skip to content

Instantly share code, notes, and snippets.

View FullZero5's full-sized avatar
🏠
Working from home

@FullZero FullZero5

🏠
Working from home
View GitHub Profile
@FullZero5
FullZero5 / index.js
Created September 7, 2020 08:43 — forked from rgabaydullov/index.js
Vue error handling example
/* учитывайте, что глобальный метод window.onerror
не будет ловить исключения без Vue.config.errorHandler */
Vue.config.errorHandler = (error, vm, info) => {
return middlewareErrorHandler(error, info);
}
// сюда попадут все ошибки, которые находятся за пределами исполнения Vue
window.onerror = (
message,
@FullZero5
FullZero5 / index.js
Created September 7, 2020 08:43 — forked from rgabaydullov/index.js
VanillaJS error handling example
/* middleware может принимать любое количество аргументов любых типов */
const middleware = (...args) => {
const [event, ...data] = args;
if (event.error) {
/* поймали объект экземпляр Error */
return event.error;
}
#!/bin/sh
branch=$1
if [ ! -z "$1" ]
then
git branch -D $branch
git push -d origin $branch
else
echo "Branch name is not specified"
@FullZero5
FullZero5 / upgrade.sh
Created September 2, 2018 08:58 — forked from artemsky/upgrade.sh
PHP 7.2 Cloud9
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
@FullZero5
FullZero5 / import_json_appsscript.js
Created April 30, 2018 18:46 — forked from chrislkeller/import_json_appsscript.js
Adds what amounts to an =ImportJSON() function to a Google spreadsheet... To use go to Tools --> Script Editor and add the script and save.
/**
* 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();
@FullZero5
FullZero5 / import_json_appsscript.js
Created April 30, 2018 18:46 — forked from chrislkeller/import_json_appsscript.js
Adds what amounts to an =ImportJSON() function to a Google spreadsheet... To use go to Tools --> Script Editor and add the script and save.
/**
* 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();
@FullZero5
FullZero5 / sendform-to-telegram.php
Created April 3, 2018 19:08 — forked from palnov/sendform-to-telegram.php
Отправка данных с форм в телеграм
<?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'])) {
@FullZero5
FullZero5 / raketa_api.php
Created April 3, 2018 19:02 — forked from kolyaraketa/raketa_api.php
TELEGRAM API: sendDocument to telegram for website form
<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";
// store/index.js
const createStore = () => {
return new Vuex.Store({
state: {
counter: 0,
repos: []
},
actions: {
LOAD_REPOS: function({ commit }) {
axios.get('url').then((res) => {