Skip to content

Instantly share code, notes, and snippets.

View kitten's full-sized avatar

Phil Pluckthun kitten

View GitHub Profile
@kitten
kitten / New React Component Pattern.js
Created May 18, 2015 20:50
React ES6 Code Samples for Medium #2
import React from "react";
export default class HelloWorld extends React.Component {
constructor(props) {
super(props);
this.state = {
world: "World"
};
}
@kitten
kitten / Old React Component Pattern.js
Last active August 29, 2015 14:21
React ES6 Code Samples for Medium #1
var React = require("react");
var HelloWorld = React.createClass({
mixins: [
DummyMixin
],
getInitialState: function() {
return {
world: "World"
};
@kitten
kitten / gist:a2ca1a7718d9fe94aa7d
Created April 2, 2015 00:58
Little bash function that uses Spark to display the CPU usage on a dual core Mac.
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"
}