borrowed from : https://gist.github.com/springmeyer/3427021
prior to running thr script you will need to allow epl6 repos with:
# enable EPEL6 by changing enabled=0 -> enabled=1
sudo vim /etc/yum.repos.d/epel.repo
private void enableHTML5AppCache() { | |
webView.getSettings().setDomStorageEnabled(true); | |
// Set cache size to 8 mb by default. should be more than enough | |
webView.getSettings().setAppCacheMaxSize(1024*1024*8); | |
// This next one is crazy. It's the DEFAULT location for your app's cache | |
// But it didn't work for me without this line | |
webView.getSettings().setAppCachePath("/data/data/"+ getPackageName() +"/cache"); |
packages: | |
yum: | |
gcc-c++: [] | |
make: [] | |
sources: | |
/home/ec2-user: http://download.redis.io/releases/redis-2.8.4.tar.gz | |
commands: | |
redis_build: | |
command: make | |
cwd: /home/ec2-user/redis-2.8.4 |
borrowed from : https://gist.github.com/springmeyer/3427021
prior to running thr script you will need to allow epl6 repos with:
# enable EPEL6 by changing enabled=0 -> enabled=1
sudo vim /etc/yum.repos.d/epel.repo
# usage: curl https://[gist-raw-url] | bash | |
sudo yum -y update; | |
sudo yum -y upgrade; | |
sudo yum -y install git nodejs npm postgresql-devel --enablerepo=epel | |
git clone https://github.com/mapnik/node-mapnik.git | |
cd node-mapnik | |
git checkout 1.4.1 |
#!/usr/local/bin/python | |
import sys | |
import sqlparse | |
# usage cat test.sql | ./format_sql.py > test2.sql | |
def main(argv): | |
sql = sys.stdin.read().replace('\n', '') | |
print sqlparse.format(sql, reindent=True, keyword_case='upper') |
CREATE FUNCTION stage_files(text) RETURNS text AS $$ | |
DECLARE | |
path ALIAS FOR $1; | |
BEGIN | |
RETURN path; | |
END; | |
$$ LANGUAGE plpgsql; |
#credits to: http://www.lecloud.net/post/61401763496/install-update-to-python-2-7-and-latest-pip-on-ec2 | |
# install build tools | |
sudo yum install make automake gcc gcc-c++ kernel-devel git-core -y | |
# install python 2.7 and change default python symlink | |
sudo yum install python27-devel -y | |
sudo rm /usr/bin/python | |
sudo ln -s /usr/bin/python2.7 /usr/bin/python |
sudo yum install gcc python27 python27-devel postgresql-devel | |
sudo curl https://bootstrap.pypa.io/ez_setup.py -o - | sudo python27 | |
sudo /usr/bin/easy_install-2.7 pip | |
sudo pip2.7 install psycopg2 |
violations = { | |
'VARIABLES': { | |
'CompanyPlotNumber': [0], | |
'DisturbanceYear': [3], | |
'DisturbanceDay': [5], | |
'DisturbanceNumber': [1], | |
'DisturbanceComment': [6], | |
'DisturbanceCode': [2], | |
'DisturbanceMonth': [4], | |
'CompoundFKey': [7], |
CREATE OR REPLACE FUNCTION normalize() RETURNS boolean AS $$ | |
DECLARE | |
a_record_exists boolean; | |
BEGIN | |
PERFORM fix_staging_dates(); | |
SELECT 1 INTO a_record_exists | |
FROM vw_bio_val_normalized | |
WHERE (OrganizationName || CompanyPlotNumber || TreeNumber || MeasurementNumber || MeasurementYear) IN | |
( |