Skip to content

Instantly share code, notes, and snippets.

View whyvez's full-sized avatar

Yves Richard whyvez

View GitHub Profile
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
@whyvez
whyvez / avca_regions
Last active August 29, 2015 14:06 — forked from benshaw/avca_regions
{
"regions": {
"Banff Yoho Kootenay": {
"display": "Banff, Yoho and Kootenay National Parks",
"url": "http://avalanche.pc.gc.ca/CAAML-eng.aspx?d=TODAY&r=1",
"type": "parks"
},
"Glacier": {
"display": "Glacier National Park",
"url": "http://avalanche.pc.gc.ca/CAAML-eng.aspx?d=TODAY&r=3",
-- API --
validate_upload(upload_id) --inserts from get_upload_violations
exec delete_duplicates()upload_id -- iterate through eacj onValidate
insert from get_upload_violations(upload_id) into violations -- query on all rules without insert
delete_upload()
-- API --
validate_upload(upload_id) --inserts from get_upload_violations
exec delete_duplicates()upload_id -- iterate through eacj onValidate
insert from get_upload_violations(upload_id) into violations -- query on all rules without insert
delete_upload()
#!/bin/bash
#
# Script to setup a Elastic Beanstalk AMI with geospatial libraries and postGIS
#
# sh aws_ami_prep.sh > aws_ami_prep.log 2>&1 &
# Go to ec2-user home directory
cd /home/ec2-user
# yum libraries
@whyvez
whyvez / backup
Last active August 29, 2015 14:24
#!/bin/bash
SERVER=yourwebsite.com
tar -cjf- ~/.crypt/passwd ~/.ssh ~/.bashrc ~/.profile ~/.vimrc ~/.gitconfig \
~/.config/chromium ~/.mozilla \
| openssl enc -aes-256-cbc \
| ssh $SERVER 'cat>~/www/backup/`date +%F.%T`'
ssh $SERVER 'ls -1 ~/www/backup | grep ^[0-9] | sort > ~/www/backup/list.txt'
@whyvez
whyvez / shoot.sh
Created November 9, 2015 22:54 — forked from zmpeg/shoot-osx.sh
shoot
#!/bin/bash
#
# Takes a screenshot, puts the URL in your clipboard,
# Then syncronizes the screenshot to your configured host
LOCALDIR="$HOME/documents/screenshots/"
REMOTEHOST="mjz.me"
REMOTEDIR="/home/matt/public/mjz.me/public/s/"
TIMESTAMP=`date +%s`
WEBHOST="http://mjz.me/s/"
@whyvez
whyvez / gist:2bf7f8bc6074f026055d
Created February 12, 2016 21:58 — forked from fonnesbeck/gist:71fb84319d33e3227e87
Installing rpy2 against Homebrew R
env LDFLAGS="-L/usr/local/Cellar/r/3.1.0/R.framework/Versions/3.1/Resources/lib -L/usr/local/opt/openblas/lib" \
python setup.py build
python setup.py install
python -m 'rpy2.tests'
@whyvez
whyvez / xyz_vs_tms.md
Created May 13, 2016 14:55 — forked from tmcw/xyz_vs_tms.md
The difference between XYZ and TMS tiles and how to convert between them

The difference between XYZ and TMS tiles and how to convert between them

Lots of tile-based maps use either the XYZ or TMS scheme. These are the maps that have tiles ending in /0/0/0.png or something. Sometimes if it's a script, it'll look like &z=0&y=0&x=0 instead. Anyway, these are usually maps in Spherical Mercator.

Good examples are OpenStreetMap, Google Maps, MapBox, MapQuest, etc. Lots of maps.

Most of those are in XYZ. The best documentation for that is slippy map tilenames on the OSM Wiki, and Klokan's Tiles a la Google.