Skip to content

Instantly share code, notes, and snippets.

View liuyxpp's full-sized avatar

Yi-Xin Liu liuyxpp

View GitHub Profile
#!/bin/bash
# Install sleepwatcher
cd /tmp
curl -O http://www.bernhard-baehr.de/sleepwatcher_2.2.tgz
tar -zxvf sleepwatcher_2.2.tgz
cd sleepwatcher_2.2
sudo mkdir -p /usr/local/sbin /usr/local/share/man/man8
sudo cp sleepwatcher /usr/local/sbin
sudo cp sleepwatcher.8 /usr/local/share/man/man8
sudo cp config/de.bernhard-baehr.sleepwatcher-20compatibility.plist /Library/LaunchAgents
@liuyxpp
liuyxpp / flaskplotlib.py
Created September 29, 2011 09:33 — forked from wilsaj/flaskplotlib.py
Example of rendering a matplotlib image directly to Flask view
from flask import Flask, make_response, render_template
app = Flask(__name__)
@app.route("/")
def index():
render_template("index.html")
@app.route("/simple.png")
def simple():
import datetime