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
@egoist
egoist / ream.md
Last active February 7, 2017 13:21

server.js:

import ream from 'ream'

const app = ream({
  pageDirectory: 'pages'
})

app.get('/', (req, res) => {
@egoist
egoist / reapi.js
Created February 7, 2017 12:08
Refined framework for building API service.
const reapi = require('reapi')
reapi({
view: {
'/': (req, res) => {
res.send
}
}
})
tooling react build
# resolve tooling-react
tooling build
# resolve tooling/lib/build
tooling dev
# resolve tooling/lib/dev
module.exports = {
template: 'handlebars',
templateOptions: {
helpers: {
raw: function(options) {
return options.fn(this)
}
}
},
prompts: {

a server for serving docs

./source/a.md ./source/b.md

./page/a

or use next.js

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