This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.
To capture the video (filesize: 19MB), using the free "QuickTime Player" application:
#!/usr/bin/env python | |
# coding: utf-8 | |
# You need PIL <http://www.pythonware.com/products/pil/> to run this script | |
# Download unifont.ttf from <http://unifoundry.com/unifont.html> (or use | |
# any TTF you have) | |
# Copyright 2011 Álvaro Justen [alvarojusten at gmail dot com] | |
# License: GPL <http://www.gnu.org/copyleft/gpl.html> | |
from image_utils import ImageText |
# -*- coding: utf-8 -*- | |
from .bananas import Bananas | |
from .base import the_api | |
the_api.add_url_rule('/bananas', view_func=Bananas.as_view('bananas')) | |
the_api.add_url_rule('/farm/<farm_id>/bananas', view_func=Bananas.as_view('bananas_from_a_farm')) | |
__all__ = [ |
/* | |
-------------------------------- | |
imgur Upload | |
-------------------------------- | |
+ https://github.com/pinceladasdaweb/imgur-upload | |
+ version 1.1 | |
+ Copyright 2014 Pedro Rogerio | |
+ Licensed under the MIT license | |
+ Documentation: https://github.com/pinceladasdaweb/imgur-upload |
#!/usr/bin/python | |
# | |
# CSV logging script for stock dump1090 | |
# | |
# Uses the Requests library to compare the state of planes in view | |
# and prints changes to standard out | |
# | |
# Start dump1090 | |
# modify this script to point to your dump1090 URL if different | |
# run the script and pipe the output to a file eg: |
class CachedMixin(object): | |
def get(self, *args, **kwargs): | |
cache_key, cache_ttl = self.get_cache_params(*args, **kwargs) | |
response = cache.get(cache_key) | |
if response is None: | |
response = super(CachedMixin, self).get(*args, **kwargs) | |
response.render() | |
cache.set(cache_key, response, cache_ttl) | |
return response |
import cProfile | |
import pstats | |
from django.utils.functional import wraps | |
def cprofile(sort_by='cumulative', n=20): | |
"""Decorator to profile a function.""" | |
def decorator(func): | |
@wraps(func) |
from functools import wraps | |
from flask import Flask, request | |
app = Flask(__name__) | |
key = "ya29.bwLu0ruxXdXe_RMOSYgfiCPORNMHLkf9rCDmV1rKtWu90TuF1d8B2SmdUlrjeOWNYThkgMM" | |
def secure(f): | |
@wraps(f) | |
def check_authorization(*args, **kwargs): | |
if request.headers.get("Authorization") == key: | |
return f() |
$> sudo strace -p `pidof "ntfsresize"` -e trace=write 2>&1 | grep 'write(1' | |
[...] | |
write(1, " 87.38 percent completed\r", 25) = 25 | |
write(1, " 87.38 percent completed\r", 25) = 25 | |
write(1, " 87.92 percent completed\r", 25) = 25 | |
write(1, " 87.92 percent completed\r", 25) = 25 | |
[...] |