This file contains hidden or 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
https://github.com/vuejs/vue-devtools/issues/620 | |
This may be brittle but in production if you are not getting a connection of vue 2.x.13 you can do this. We wanted this in our QA environments when needed. | |
// Before you create app | |
Vue.config.devtools = true; | |
// After you create app | |
window.__VUE_DEVTOOLS_GLOBAL_HOOK__.Vue = app.constructor; |
This file contains hidden or 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 | |
/** | |
* Возвращает сумму прописью | |
* @author runcore | |
* @uses morph(...) | |
*/ | |
function num2str($num) { | |
$nul='ноль'; | |
$ten=array( | |
array('','один','два','три','четыре','пять','шесть','семь', 'восемь','девять'), |
This file contains hidden or 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
request.onload = () => { | |
// в момент вызова этой функции в переменной request.response | |
// будет javascript объект типа Blob | |
// создаём ссылку на Blob-файл (не путать с base64!), по этой ссылке можно открыть или скачать файл | |
// такая ссылка имеет особый вид `blob:https://ru.stackoverflow.com/a6fb157b-d130-4b7a-a372-e183a95292c1` | |
const url = window.URL.createObjectURL(request.response); | |
// открыть файл в новой вкладке | |
window.open(url); |
This file contains hidden or 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
// use responseType: 'blob' | |
axios({ | |
url: 'http://localhost/download_pdf', | |
method: 'GET', | |
responseType: 'blob', // <-- | |
}).then(response => { | |
const blob_file = response.data; | |
const file_url = URL.createObjectURL(blob_file); | |
window.open(file_url); // open file in new tab | |
}); |
This file contains hidden or 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).on('storage', function (e) { | |
if (e.originalEvent.key == 'token') { | |
let token = e.originalEvent.newValue; | |
window.axios.defaults.headers.common['Authorization'] = `Bearer ${token}`; | |
store.commit('LOGIN', {token}); | |
} | |
}); |
This file contains hidden or 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.axios.interceptors.request.use( | |
config => { | |
/* | |
const token = localStorage.getItem('token'); | |
if (token) { | |
console.log(token); | |
config.headers.Authorization = `Bearer ${token}`; | |
} else { |
This file contains hidden or 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
// variant 1. Press Ctrl+W | |
var e = jQuery.Event("keypress"); | |
e.which = 'w'.charCodeAt(); // # Some key code value | |
e.ctrlKey = true; | |
$(document).trigger(e); | |
// variant 2. Press Ctrl+W | |
$.event.trigger({ type : 'keypress', which : 'w'.charCodeAt(), ctrlKey: true }); |
This file contains hidden or 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
SELECT IBLOCK_ELEMENT_ID, COUNT(VALUE), VALUE FROM `b_iblock_element_property` WHERE `IBLOCK_PROPERTY_ID` = 21 AND `IBLOCK_ELEMENT_ID` = 63426 GROUP BY VALUE | |
SELECT IBLOCK_ELEMENT_ID, COUNT(VALUE), VALUE FROM `b_iblock_element_property` WHERE `IBLOCK_PROPERTY_ID` = 1412 AND `IBLOCK_ELEMENT_ID` = 63426 GROUP BY VALUE |
This file contains hidden or 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
<? | |
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/prolog_before.php"); | |
function download_translit($filename) { | |
static $tbl = array( | |
'а'=>'a', 'б'=>'b', 'в'=>'v', 'г'=>'g', 'д'=>'d', 'е'=>'e', 'ж'=>'g', 'з'=>'z', | |
'и'=>'i', 'й'=>'y', 'к'=>'k', 'л'=>'l', 'м'=>'m', 'н'=>'n', 'о'=>'o', 'п'=>'p', | |
'р'=>'r', 'с'=>'s', 'т'=>'t', 'у'=>'u', 'ф'=>'f', 'ы'=>'y', 'э'=>'e', 'А'=>'A', | |
'Б'=>'B', 'В'=>'V', 'Г'=>'G', 'Д'=>'D', 'Е'=>'E', 'Ж'=>'G', 'З'=>'Z', 'И'=>'I', |
This file contains hidden or 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
AmCharts.themes.rk = { | |
AmChart: { | |
color: "#000000" | |
}, | |
AmCoordinateChart: | |
{ | |
colors: ["#4f81bd", "#ff0000", "#77933c", "#c9e6f2", "#c9f0e1", | |
"#e8d685", "#e0ad63", "#d48652", "#d27362", "#495fba", "#7a629b", |