Skip to content

Instantly share code, notes, and snippets.

View mobilestack's full-sized avatar

Tony mobilestack

View GitHub Profile
@mobilestack
mobilestack / django-translate.md
Last active August 29, 2015 14:02
django translate issue

./manage.py makemessages -l zh_CN
要大写的CN而不是小写的,之后
./manage.py compilemessages

chrome cached files, but not able to discover, or on the server side, some files are cached

#########################
# .gitignore file for Xcode5
#
# NB: if you are storing "built" products, this WILL NOT WORK,
# and you should use a different .gitignore (or none at all)
# This file is for SOURCE projects, where there are many extra
# files that we want to exclude
#
# For updates, see: http://stackoverflow.com/questions/49478/git-ignore-file-for-xcode-projects
# and https://gist.github.com/adamgit/3786883

Launch Sublime Text 2 from the Mac OS X Terminal

Sublime Text 2 ships with a CLI called subl (why not "sublime", go figure). This utility is hidden in the following folder (assuming you installed Sublime in /Applications like normal folk. If this following line opens Sublime Text for you, then bingo, you're ready.

open /Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl

You can find more (official) details about subl here: http://www.sublimetext.com/docs/2/osx_command_line.html

Installation

# You will need to run these with superuser permissions.
# Either prefix `sudo` to all commands, or switch user
# Be very careful when you switch user
sudo su - root
# Update all the packages
yum update
# Install the basics - python27, gcc, svn, git, httpd, make, uuid
@mobilestack
mobilestack / install onavo
Last active September 16, 2016 18:22
安装onavo的方法
http://tieba.baidu.com/p/2793623486 这里去找链接,输入到safari即可,即使没有下载onavo软件也可以
http://mobile.163.com/13/1218/00/9GB92A1C0011671M.html 这里去配置
@mobilestack
mobilestack / postgresql id_seq reset.md
Last active August 14, 2018 21:33
postgresql id_seq reset

SELECT MAX(id) FROM your_table; SELECT nextval('your_table_id_seq'); SELECT setval('your_table_id_seq', (SELECT MAX(id) FROM your_table));

@mobilestack
mobilestack / proj installation on linux.md
Last active August 29, 2015 13:55
proj.4.8.0 install failure on Linux

https://code.zmaw.de/boards/2/topics/895

to add --without-jni, so it is

./configure --prefix=/home1/username/proj --without-jni

in the downloaded and extracted proj file.

Then when installing Postgis on Bluehost, just download postgis and run inside the extracted file folder:

@mobilestack
mobilestack / gdal geos for python33 on Windows7 x64.md
Last active August 29, 2015 13:55
Install Gdal for Postgis on Windows7, x64, Python3.3

I am developing a Django site and my development machine uses Windows7, X64, since Postgis is more or less the best option, I decided to migrate my database from sqlite3 to Postgresql, and on production side, migrating Mysql to Postgresql.

So on development side, I install the Postgresql from a binary installer, which includes an optional Postgis extension for intallation. Although it says Gdal is included, but my Python3.3 just cannot find it. If I test it in Python:

from osgeo import gdal

or

from django.contrib.gis import gdal

In my quest to learn how to use python within the django framework, the most difficult thing was the development environment, and getting to the point where I could play learn, practice and experiment. Here are some steps that I took to get to that point.

I’ll add to this as I can, but mostly I’m using it as a handy resource that I can access while continuing to learn.

SETUP DJANGO PROJECT IN MY MAC OS DEV ENV

Cribbed from my notes and this blog post.