Skip to content

Instantly share code, notes, and snippets.

@blurrcat
blurrcat / tomato.sh
Created August 21, 2017 07:25
Remind you to take a break from work once in a while
#!/bin/bash
# Remind you to take a 10-min break every 50 min.
# It will send a notification and speak on OSX. On other platform, it just prints a message in the console..
user=`whoami`
worktime=3000
breaktime=570
backtime=30
function notify {
which osascript > /dev/null && osascript -e "display notification \"$1\" with title \"Mr. Tomato\" subtitle \"$2\""
@blurrcat
blurrcat / app.py
Last active August 29, 2015 14:05
Deferred database initialization for flask-peewee.db.Database
from flask import Flask
from db import db
def create_app(config_obj)
app = Flask('tets')
app.config.fromobj(config_obj) # db configured in `config_obj`
db.init_app(app)