Skip to content

Instantly share code, notes, and snippets.

View Akryum's full-sized avatar
☮️
Meow

Guillaume Chau Akryum

☮️
Meow
View GitHub Profile
@Akryum
Akryum / QuestionItem.vue
Last active February 7, 2019 17:43
Vue.js composition utils
<template>
<DynamicScrollerItem
:item="item"
:active="active"
:size-dependencies="[
idState.answering,
data.answer,
isLiveAnswering,
]"
>
@Akryum
Akryum / preset.json
Last active December 30, 2018 22:44
Nodepack Preset
{
"name": "My preset",
"useConfigFiles": false,
"plugins": {
"@nodepack/plugin-babel": "^0.0.1",
"@nodepack/plugin-typescript": "^0.0.1"
},
"appMigrations": {
"@nodepack/plugin-typescript": {
"default-template@0.0.1": {
@Akryum
Akryum / localization.md
Last active November 11, 2018 12:28
Help translate @vue/cli-ui!

Localization

Translate the UI

Follow those simple steps to propose a new language for the CLI UI!

  1. Run navigator.languages or navigator.language to get the language code for the new locale. For example: 'fr'.

  2. Search NPM to see if a package called vue-cli-locale-<language code> doesn't already exist. If it does, please contribute to it by submitting PRs! If you don't find any, create a new package called vue-cli-locale-<language code>. For example: vue-cli-locale-fr

@Akryum
Akryum / main.js
Last active September 17, 2018 10:56
NativeScript Vue devtools example
import Vue from 'nativescript-vue'
import router from './router'
import store from './store'
import devtools from '@vue/devtools'
// Prints Vue logs when --env.production is *NOT* set while building
Vue.config.silent = (TNS_ENV === 'production')
const app = new Vue({
router,
<script>
export default {
inheritAttrs: false,
props: {
index: {
type: [String, Number],
default: null,
},

3.0.0-rc.3 (2018-06-18)

cli

Bug Fixes

  • invoke: deep merge only plain objects (a7f3c2c)
  • invoke: merge data in config transforms (35cb714)
  • invoke: not reading dot files (49d56db)
  • better version check, closes #1564 (8b9477f)
@Akryum
Akryum / main.backup.js
Last active July 3, 2018 16:16
vue-cli SSR
// Existing imports
import Vue from 'vue'
import router from './router'
import store from './store'
// Other existing code here
// Add 'app' variable
const app = new Vue({
// Existing options
@Akryum
Akryum / style.styl
Created June 9, 2018 15:15
Vue cli-ui plugin dark mode
@import '~@vue/cli-ui/src/style/imports'
.my-class
background $vue-ui-color-light-neutral
.vue-ui-dark-mode &
background $vue-ui-color-dark
@Akryum
Akryum / cache.js
Created May 8, 2018 13:16
Micro cache
const LRU = require('lru-cache')
// Micro-caching
exports.cache = function (resolver, keyFactory, { max = 500, maxAge = 3000, perUser = true } = {}) {
const microCache = new LRU({
max,
maxAge,
})
return async (holder, args, context) => {
let key = typeof keyFactory === 'function' ? keyFactory(holder, args, context) : keyFactory
@Akryum
Akryum / ui.js
Last active March 24, 2018 20:51
@vue/cli-ui plugin API
// @vue/cli-plugin-eslint/ui.js
module.exports = api => {
// Config file
api.describeConfig({
name: 'ESLint configuration',
description: 'Error checking & Code quality',
link: 'https://eslint.org',
files: {
json: ['eslintrc', 'eslintrc.json'],