This file contains 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
http://vim.wikia.com/wiki/ | |
GREP STUFF | |
========== | |
The :substitute command searches for a text pattern, and replaces it with a text string. There are many options, but these are what you probably want: | |
:%s/foo/bar/g | |
Find each occurrence of 'foo', and replace it with 'bar'. | |
:%s/foo/bar/gc |
This file contains 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
-------------------- | |
GROUP BY, DISTINCT | |
-------------------- | |
"group by" lets you use aggregate functions, like avg, max, min, sum, and count. "distinct" just removes duplicates. | |
For example, if you have a bunch of purchase records, and you want to know how much was spent by each department, you might do something like: | |
select department, sum(amount) from purchases group by department | |
This will give you one row per department, containing the department name and the sum of all of the "amount" values in all rows for that department. |
This file contains 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
Best Solution - GoogleApps | |
Here's a summary of what I setup and how: | |
Signed-up at GoogleApps. The "Standard Edition" is just fine for me to get email service. | |
Next step is to validate your domain ownership by either posting a special file on a website running at the domain, or insert a special CNAME record in your dns entry | |
Once the domain is validated, the chat, docs, calendar and sites features will be active. | |
To enable Email, also need to configure the MX records for your domain | |
I have a domain registered at http://whois.com, but it was just pointing to a domain parking page, so I first had to add the "Managed DNS" service to my whois account and change my nameservers from the domain-parking addresses to the whois.com nameservers. Seemed to take about a day for this to propagate properly before I could proceed. | |
I added the special CNAME entry (as prompted by google) and told google apps to try and verify my domain ownership | |
Then simply had to add the MX records as prompted by google. |
This file contains 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
-To have unversioned files add a .gitignore file in project root with name of files to ignore in it. | |
------------------------------------------- | |
Error ==> How to solve it | |
ERROR: adeleinr/SocialCard doesn't exist yet. Did you enter it correctly? | |
fatal: The remote end hung up unexpectedly | |
Edit the .git/config |
This file contains 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
What to check if site is down | |
------------------------------ | |
1) check that A record is pointing to vps IP. I this case A should be followed by an IP. | |
dig ddailygirl.com | |
; <<>> DiG 9.7.0-P1 <<>> ddailygirl.com | |
;; global options: +cmd | |
;; Got answer: |
This file contains 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
General | |
------------------------------------------------ | |
alias django='cd /django/trunk/django/' | |
alias mysite='cd /projects/mysite' | |
alias start_fcgi='mysite; sudo python manage.py runfcgi host=127.0.0.1 port=8080 --settings=settings; cd -;' | |
alias stop_fcgi='mysite; sudo killall python manage.py; cd -;' | |
alias restart_fcgi='mysite; sudo killall python manage.py; sudo python manage.py runfcgi host=127.0.0.1 port=8080 --settings=settings; cd -;' | |
alias syncdb='mysite; sudo python manage.py syncdb; cd -;' | |
alias shell='mysite; sudo python manage.py shell; cd -; |
This file contains 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
Django Features to Explore | |
--------------------------- | |
-a full-featured database API | |
-a built-in authentication and permissions system for user accounts | |
-"Generic views," which save you from having to write code for common things like date-based content archives | |
-a built-in cache system to help you squeeze every possible ounce of performance out of Django | |
-an internationalization system to make it easy to translate your application's interface into other languages | |
-easy, automatic generation of RSS feeds and Google sitemaps | |
-easy serialization of data to XML or JSON, for easy use with AJAX | |
plus a whole lot more |
This file contains 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
""" | |
This fabric file makes setting up and deploying a django application much | |
easier, but it does make a few assumptions. Namely that you're using Git, | |
Apache and mod_wsgi and your using Debian or Ubuntu. Also you should have | |
Django installed on your local machine and SSH installed on both the local | |
machine and any servers you want to deploy to. | |
_note that I've used the name project_name throughout this example. Replace | |
this with whatever your project is called._ |
This file contains 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
Hide all windows --> Ctrl + Alt + d |
This file contains 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
Flush DNS Cache | |
OSX (10.5) | |
---------- | |
dscacheutil -flushcache | |
Windows | |
------- | |
C:\>ipconfig /flushdns | |