This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* | |
* PERSISTENT LOCALSTORAGE NATIVE SOLUTION for phonegap (tested on 1.3) | |
* iOS 5.1 puts LocalStorage in a vulnerable location (Libary/Caches). This will copy it to | |
* the documents folder as "appdata.db" so that it will be appropriately backed-up and not | |
* overwritten. If "appdata.db" doesn't exist, localStorage will not be overwritten. | |
* Also, upon application suspend (resignActive) or termination, localStorage is saved, so | |
* there should not be any chance that changes to localStorage won't be persisted. [[ short of a power-cycle ]] | |
* | |
* The following should be placed in AppDelegate.m. Note that it //partially// replaces |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (BOOL) application:(UIApplication*)application didFinishLaunchingWithOptions:(NSDictionary*)launchOptions | |
{ | |
[NSClassFromString(@"WebView") _enableRemoteInspector]; | |
/** .. do your AppDelgate thing.. **/ | |
return YES; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
URL=`curl -i http://git.io -F "url=$1" | grep Location | sed -e 's/Location: //g'` | |
echo "$URL" | pbcopy | |
echo "$URL" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nameserver 127.0.0.1 | |
port 20560 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo yum install git nginx pcre-devel libxml2-devel libxslt-devel gd-devel geoip-devel | |
curl -O http://nginx.org/download/nginx-1.0.4.tar.gz | |
git clone git://github.com/yaoweibin/nginx_tcp_proxy_module | |
tar zxf nginx-1.0.4.tar.gz | |
cd nginx-1.0.4/ | |
patch -p1 < ../nginx_tcp_proxy_module/tcp.patch | |
./configure --add-module=../nginx_tcp_proxy_module/ --user=nginx --group=nginx --prefix=/usr/share/nginx --sbin-path=/usr/sbin/nginx --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --http-client-body-temp-path=/var/lib/nginx/tmp/client_body --http-proxy-temp-path=/var/lib/nginx/tmp/proxy --http-fastcgi-temp-path=/var/lib/nginx/tmp/fastcgi --http-uwsgi-temp-path=/var/lib/nginx/tmp/uwsgi --http-scgi-temp-path=/var/lib/nginx/tmp/scgi --pid-path=/var/run/nginx.pid --lock-path=/var/lock/subsys/nginx --with-http_ssl_module --with-http_realip_module --with-http_addition_module --with-http_xslt_module --with-http_image_filter_module --with-http_geoip_module --wi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fs = require 'fs' | |
log = console.log | |
spawn = require('child_process').spawn | |
task 'server', 'Start server.coffee and restart on file change', -> | |
log "Starting server, kill with Ctrl-c" | |
server = spawn "coffee", ["server.coffee"] | |
server.stdout.on "data", (data) -> | |
log "#{data}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for file in `ls *.jpg.jpg`; do mv $file $file:gs/.jpg.jpg/.jpg/; done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// add UIScrollViewDelegate | |
@interface AppDelegate : PhoneGapDelegate <UIScrollViewDelegate> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Beans | |
from : [ 'Central America', 'South America', 'East Africa' ] | |
brand : 'Gevalia' | |
name : 'Ebony' | |
class Coffee extends Beans | |
sugar : no | |
milk : no | |
people = [ 'Andreas', 'Sofia' ] |