Skip to content

Instantly share code, notes, and snippets.

Miljan miljan-aleksic

Block or report user

Report or block miljan-aleksic

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@Akryum
Akryum / vue.config.js
Last active Feb 6, 2019
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
hk-skit / js-oneliner.js
Last active May 9, 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 => [...new Set(array)];
const removeDuplicates2 = array => Array.from(new Set(array));
// Flattens an array(doesn't flatten deeply).
@shilman
shilman / storybook-3.2-alpha.md
Last active Apr 17, 2019
Storybook 3.2-alpha Feedback
View storybook-3.2-alpha.md

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
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 })
}
}
}
View route-based-chunking.md

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.