Skip to content

Instantly share code, notes, and snippets.

:bowtie:
Freelancer.

EGOIST egoist

View GitHub Profile
View styled-html.js
const color = 'red'
const App = styled.div`{
color: ${color};
}`
App.innerHTML = 'hello world'
document.body.appendChild(App)
View elx.js
import Elx, {h} from 'elx'
class Button extends Elx {
state = {
count: 0
}
increment = () => {
this.set('count', this.state.count + 1)
}
View router.js
import routerga from 'vue-router-ga'
const router = new Router()
routerga(router, 'UA-XXXXX-Y')
@egoist
egoist / mini-yaml.md
Last active Dec 14, 2016
The minimal YAML alternative markup language
View mini-yaml.md
title: Hello
space: "with space"
array:
 - foo
 - bar
obj:
  foo:
    bar: 123
View docute-example.html
<div id="#app"></div>
<script src="/path/to/docute.js"></script>
<script>
docute.data.toc
/*
[
{title: 'head title', children: []}
]
*/
View tasco-new.js
import task from 'tasco'
task('foo', t => {
t.input('./src/index.js')
.pipe(babel())
.pipe(t.output('./dist'))
})
View markdown-to-page.md

Given markdown:

# Vue 2.0

## Quick Start

### Install
View pendragon.js
const counter = pen({
count: 0
})
.mutation('increment', ctx => {
ctx.state.count++
})
.render((h, ctx) => h('button', {
on: {
click: () => ctx.commit('increment')
}
View markdown-to-vue.md

Given markdown code:

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

fine, thanks.
View cocss.js
// component oriented css
import {css} from 'cocss'
import cssDOM from 'cocss/dom'
const style = cssDOM.renderToString({
color: 'red',
backgroundColor: 'cyan'
})
// style:
You can’t perform that action at this time.