Skip to content

Instantly share code, notes, and snippets.

@yec
yec / http_client_with_cache.coffee
Created March 26, 2012 00:34 — forked from johnthethird/http_client_with_cache.coffee
HTTPClientWithCache for Titanium in CoffeeScript
###
------> HTTPClientWithCache <------
This class is a wrapper around the standard Titanium.Network.HTTPClient(), but it adds a
few nice features:
* A cache backed by a SQLite database. All HTTPClientWithCache instances use the same database table, with
the primary cache key being a hash of the full URL (and any data parameters in a POST)
* The cache is automatically pruned before each query
* A retry mechanism, so that you can retry a particular query a number of times before failing.
@yec
yec / upload-img-to-imgur.bash
Created February 17, 2012 02:59 — forked from alvin2ye/upload-img-to-imgur.bash
upload image to imgur.bash
#!/bin/bash
# imgur script by Bart Nagel <bart@tremby.net>
# version 2
# I release this as public domain. Do with it what you will.
# Required: curl
#
# Optional: xsel or xclip for automatically putting the URL on the X selection
# for easy pasting