Skip to content

Instantly share code, notes, and snippets.

@addyosmani
addyosmani / route-based-chunking.md
Last active December 28, 2021 06:18
Route-based chunking

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

@chartinger
chartinger / TestHelper.js
Created January 11, 2017 10:47
Simple Vue.js shallow render helper
import Vue from 'vue'
const mockComponent = function (name, props) {
return {
props: props,
render: function (createElement) {
return createElement(name, { props: props })
}
}
}
@shilman
shilman / storybook-3.2-alpha.md
Last active April 17, 2019 00:15
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.

@uraimo
uraimo / dnsovertls.md
Last active March 22, 2024 20:55
Configure your Mac to use DNS over TLS
@hk-skit
hk-skit / js-oneliner.js
Last active January 9, 2024 23:46
Useful Array One-liners.
// 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).
@Akryum
Akryum / vue.config.js
Last active April 26, 2020 14:18
Auto-import styles with vue-cli 3
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) {

With GitHub Actions, a workflow can publish artifacts, typically logs or binaries. As of early 2020, the life time of an artifact is hard-coded to 90 days (this may change in the future). After 90 days, an artifact is automatically deleted. But, in the meantime, artifacts for a repository may accumulate and generate mega-bytes or even giga-bytes of data files.

It is unclear if there is a size limit for the total accumulated size of artifacts for a public repository. But GitHub cannot reasonably let multi-giga-bytes of artifacts data accumulate without doing anything. So, if your workflows regularly produce large artifacts (such as "nightly build" procedures for instance), it is wise to cleanup and delete older artifacts without waiting for the 90 days limit.

Using the Web page for the "Actions" of a repository, it is possible to browse old workflow runs and manually delete artifacts. But the procedure is slow and tedious. It is fine to delete one selected artifact. It is not for a regular cleanup. We need