Skip to content

Instantly share code, notes, and snippets.

View egoist's full-sized avatar
🙏
Please support my open-source projects!

EGOIST egoist

🙏
Please support my open-source projects!
View GitHub Profile
import task from 'tasco'
task('foo', t => {
t.input('./src/index.js')
.pipe(babel())
.pipe(t.output('./dist'))
})

Given markdown:

# Vue 2.0

## Quick Start

### Install
const counter = pen({
count: 0
})
.mutation('increment', ctx => {
ctx.state.count++
})
.render((h, ctx) => h('button', {
on: {
click: () => ctx.commit('increment')
}

Given markdown code:

---
title: Hello world
description: nothing
---
how's it going?

fine, thanks.
// component oriented css
import {css} from 'cocss'
import cssDOM from 'cocss/dom'
const style = cssDOM.renderToString({
color: 'red',
backgroundColor: 'cyan'
})
// style:
const str = `
random()
// @remove-on-eject start
const foo = 'I will be removed'
// @remove-on-eject end
fn()
`
replaceSection({
input: str,
@egoist
egoist / miku-design.md
Last active November 11, 2016 13:31
The minimalistic ES6 web framework. (in MVC pattern)

miku 会在启动时自动加载放在 ./app/models 里的 models,文件名默认首字母大写。

The routes:

// ./app/config/routes.js
export default {
  '/': 'Home',
  '/user/:username': 'UserInfo'
}
ui/
└── layout/
├── Header.vue // component code
├── Header.play.js // component play file
├── Header.test.js // component-specific unit tests
└── Header.fixtures.json // any mock data the component tests might need
const statefulTitle = (oldTitle, set) => {
if (set) document.title = oldTitle
return newTitle => {
document.title = newTitle || oldTitle
}
}
@egoist
egoist / g.js
Created October 21, 2016 08:09
import SvgIcons from 'vue-svg-icons'
Vue.use(SvgIcons, {
icons: {
compass: require('vue-svg-icons/')
}
})
// in your component
{