This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function DateFormatter(props, context) { | |
| return ( | |
| <div>{props.date.toLocaleString(context.locale, { year: 'numeric', month: 'short', day: 'numeric' })}</div> | |
| ); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React from 'react'; | |
| import {render} from 'react-dom'; | |
| import {useStrict, computed, action, observable} from 'mobx'; | |
| import {Provider, observer, inject} from 'mobx-react'; | |
| useStrict(true); | |
| class DataStore { | |
| @observable name; | |
| constructor(name) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| alias ll='ls -la' | |
| alias cd..='cd ..' | |
| alias ..='cd ..' | |
| alias mkdir='mkdir -pv' | |
| alias h='history' | |
| alias gs='git status' | |
| alias gl='git log --oneline' | |
| mkcdir () { | |
| mkdir $1 && cd $1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const noChange = (promise, done, fail) => { | |
| promise.then(done, fail) | |
| return promise | |
| } | |
| if(Promise.prototype.done == undefined) | |
| Promise.prototype.done = function(fn){ | |
| return noChange(this,fn) | |
| } | |
| if(Promise.prototype.fail == undefined) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* the following serialize and param methods are a version of zepto's | |
| * https://github.com/madrobby/zepto/blob/601372ac4e3f98d502c707bf841589fbc48a3a7d/src/ajax.js#L344-L370 | |
| * modified to use _ (tested on [email protected], should also work in underscore) | |
| * to use with github's fetch: | |
| fetch(urrl, { | |
| method: 'post', | |
| headers: { | |
| 'Accept': 'application/json', | |
| 'Content-Type': 'application/x-www-form-urlencoded' | |
| } |