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 cpu() { | |
usage=$(ps aux | awk {'sum+=$3;print int(sum/4+.5)'} | tail -n 1) | |
graph=$(spark 0 ${usage} 100 | awk '{print substr($0,4,3)}') | |
echo "[$usage%] $graph" | |
} |
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
var React = require("react"); | |
var HelloWorld = React.createClass({ | |
mixins: [ | |
DummyMixin | |
], | |
getInitialState: function() { | |
return { | |
world: "World" | |
}; |
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"; | |
export default class HelloWorld extends React.Component { | |
constructor(props) { | |
super(props); | |
this.state = { | |
world: "World" | |
}; | |
} |
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 { PropTypes } from "react"; | |
import { CompatComponent } from "react-compat-component"; | |
export default class HelloWorld extends CompatComponent { | |
getMixins() { | |
return [ | |
DummyMixin | |
]; | |
} |
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
var AppDispatcher = require('../dispatcher/AppDispatcher'); | |
var EventEmitter = require('events').EventEmitter; | |
var assign = require('object-assign'); | |
var CHANGE_EVENT = 'change'; | |
var _elements = {}; | |
function create(obj) { | |
_elements[obj.id] = obj; |
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 ExampleStore from "../stores/example-store.js"; | |
import { CompatComponent } from "react-compat-component"; | |
export default class Example extends CompatComponent { | |
getInitialState() { | |
data: ExampleStore.getList() | |
} | |
componentDidMount() { | |
ExampleStore.addChangeListener(this._update); | |
} |
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 { EventEmitter } from "events"; | |
import { Map } from "immutable"; | |
const CHANGE_EVENT = "change"; | |
class Store extends EventEmitter { | |
constructor() { | |
super(); | |
this.data = new Map(); | |
} |
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 Store from "./Store.js"; | |
import assign from "object-assign"; | |
class Transmit { | |
constructor(Component, Storage) { | |
const Container = React.createClass({ | |
displayName: Component.displayName + "Container", | |
getInitialState() { | |
return { |
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 { PropTypes } from "react"; | |
import { CompatComponent } from "react-compat-component"; | |
import Transmit from "./transmit.js"; | |
import ExampleStore from ",/example-store.js"; | |
import { List } from "immutable"; | |
class Example extends CompatComponent { | |
getPropTypes() { | |
return { | |
data: PropTypes.instanceOf(List).isRequired |
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 { EventEmitter } from "events"; | |
import { Observable } from "rx"; | |
import { Map, List } from "immutable"; | |
export default { | |
createStore(extend) { | |
const CHANGE_EVENT = "change"; | |
const EventListener = Object.assign({}, EventEmitter.prototype, { | |
changed() { | |
this.emit(CHANGE_EVENT); |
OlderNewer