Skip to content

Instantly share code, notes, and snippets.


Miljan miljan-aleksic

View GitHub Profile
Akryum / vue.config.js
Last active Apr 26, 2020
Auto-import styles with vue-cli 3
View vue.config.js
const path = require('path')
module.exports = {
chainWebpack: config => {
const types = ['vue-modules', 'vue', 'normal-modules', 'normal']
types.forEach(type => addStyleResource(config.module.rule('stylus').oneOf(type)))
function addStyleResource (rule) {
hk-skit / js-oneliner.js
Last active Dec 20, 2019
Useful Array One-liners.
View js-oneliner.js
// Remove Duplicates from an array
const removeDuplicates =
arr => arr.filter((item, index) => index === arr.indexOf(item));
const removeDuplicates1 = array => [ Set(array)];
const removeDuplicates2 = array => Array.from(new Set(array));
// Flattens an array(doesn't flatten deeply).
uraimo /
Last active Jul 24, 2020
Configure your Mac to use DNS over TLS
shilman /
Last active Apr 17, 2019
Storybook 3.2-alpha Feedback

Storybook 3.2-alpha Feedback

We're rolling out a few big features in Storybook 3.2 and need your feedback:

  • Vue support
  • Story hierarchy

DISCLAIMERS: Our release process is for getting new features into your hands early to stabilize things. API's may change before full release!

FEEDBACK: To give feedback on a feature comment on the open issue linked below, and be sure to include the version you're using. To give feedback on the release, feel free to comment on this gist, or come chat with us on slack.

chartinger / TestHelper.js
Created Jan 11, 2017
Simple Vue.js shallow render helper
View TestHelper.js
import Vue from 'vue'
const mockComponent = function (name, props) {
return {
props: props,
render: function (createElement) {
return createElement(name, { props: props })

Route-based chunking

Many of us building single-page apps today use JavaScript module bundling tools that trend towards a monolithic "bundle.js" file including the full app and vendor code for multiple routes. This means if a user lands on any arbitrary route they need to wait for a large bundle of JS to be fetched, parsed and executed before the application is fully rendered and interactive.

screen shot 2016-09-28 at 4 45 52 pm

This is a little backwards, especially when apps are used under real-world network (3G) and device

You can’t perform that action at this time.