Functional JavaScript by Jesse Farmer is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.
Contact Jesse at jesse@20bits.com if you have any questions!
| -- a quick LUA access script for nginx to check IP addresses against an | |
| -- `ip_blacklist` set in Redis, and if a match is found send a HTTP 403. | |
| -- | |
| -- allows for a common blacklist to be shared between a bunch of nginx | |
| -- web servers using a remote redis instance. lookups are cached for a | |
| -- configurable period of time. | |
| -- | |
| -- block an ip: | |
| -- redis-cli SADD ip_blacklist 10.1.1.1 | |
| -- remove an ip: |
Functional JavaScript by Jesse Farmer is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.
Contact Jesse at jesse@20bits.com if you have any questions!
| web: node server |
These instructions work for the Raspberry Pi running Raspbian (hard float) and create a hardware optimized version of NodeJS for the Raspberry PI, (and include a working install and NPM!!!):
Install Raspbian - http://www.raspberrypi.org/downloads
Install the necessary dependecies:
sudo apt-get install git-core build-essential(If you just installed git then you need to administer your git identity first, else adding the patches below will fail!!!)
| // Set master UI background color | |
| Ti.UI.backgroundColor = '#000'; | |
| // Set vars | |
| var winMain, | |
| vwWebMain, | |
| lblValue, | |
| vwBtn; | |
| // Set global event listener as Firebase callback |
| /** | |
| * This sample lets you record and share video with Appcelerator Titanium on Android. | |
| * REQUIRES THE 1.6.0 RC OF TITANIUM MOBILE SDK | |
| * http://developer.appcelerator.com/blog/2011/02/release-candidate-for-titanium-mobile-1-6-0.html | |
| */ | |
| /** | |
| * First, create our UI. We'll have two buttons: record, and share. | |
| */ | |
| var win = Titanium.UI.createWindow({ |
| ### | |
| ------> 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. |