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
var year = | |
new Date() | |
.getFullYear() | |
.toString() | |
.substr(-2) * | |
1 + | |
1; | |
var compile = _.template( | |
"http://www.cbr.ru/statistics/b_sector/loans_nonfin_<%= year %>.xlsx" |
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
# Your snippets | |
# | |
# Atom snippets allow you to enter a simple prefix in the editor and hit tab to | |
# expand the prefix into a larger code block with templated values. | |
# | |
# You can create a new snippet in this file by typing "snip" and then hitting | |
# tab. | |
# | |
# An example CoffeeScript snippet to expand log to console.log: | |
# |
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
/*eslint no-undef: 0*/ | |
import {USER_LOGGED_IN, USER_LOGGED_OUT} from '../types' | |
import api from '../api' | |
export default { | |
userLoggedIn: ({commit}, user) => | |
commit({ | |
type: USER_LOGGED_IN, | |
user | |
}), |
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
var https = require('https') | |
var options = { | |
host: 'google.com', | |
method: 'get', | |
path: '/', | |
// To avoid an error, because the cert can be unauthorized | |
rejectUnauthorized: false | |
} |
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
const axios = require('axios'); | |
const http = require('http'); | |
const https = require('https'); | |
module.exports = axios.create({ | |
//60 sec timeout | |
timeout: 60000, | |
//keepAlive pools and reuses TCP connections, so it's faster | |
httpAgent: new http.Agent({ keepAlive: 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
// if you are on node like me and you are using v >= 6, | |
// there was a change and you should use Buffer.from or similar. | |
function getBase64(url) { | |
return axios | |
.get(url, { | |
responseType: 'arraybuffer' | |
}) | |
.then(response => Buffer.from(response.data, 'binary').toString('base64')) | |
} |
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
axios.interceptors.request.use((config) => { | |
config.foo = 123; | |
}); | |
const instance = axios.create(); | |
instance.interceptors.request.use((config) => { | |
config.foo = 456; | |
}); | |
axios.get('/foo'); // config.foo === 123 -> 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
const axios = require('axios') | |
const xml2js = require('xml2js') | |
const iconv = require('iconv-lite') | |
const parser = new xml2js.Parser({ explicitArray: false }) | |
var url = '[YOUR_WINDOWS-1251-RSS]' | |
axios.interceptors.response.use(async (response) => { | |
var contentType = response.headers['content-type'] |
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
// @file: src/components/global/index.js | |
// Global components | |
import FirstComponent from '.FirstComponent' | |
import SecondComponent from '.SecondComponent' | |
import ThirdComponent from '.ThirdComponent' | |
import FourthComponent from '.FourthComponent' | |
import FifthComponent from '.FifthComponent' | |
export default { | |
'first-component': FirstComponent, |
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
<template> | |
<draggable v-model="filters" :options="{handle:'.handle-item', animation: 500}"> | |
<transition-group> | |
<template v-for="(filter, idx) in filters"> | |
<v-layout row wrap :key="idx"> | |
<v-flex pt-4 xs1 text-xs-center v-if="filters.length > 1"> | |
<v-icon class="handle-item">reorder</v-icon> | |
</v-flex> | |
<v-flex xs6> | |
<v-text-field v-model="filter.expression" |
OlderNewer