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
| function getDirection(f, b) { | |
| var h = f.width(), | |
| d = f.height(), | |
| a = (b.x - f.offset().left - h / 2) * (h > d ? d / h : 1), | |
| c = (b.y - f.offset().top - d / 2) * (d > h ? h / d : 1), | |
| g = Math.round((Math.atan2(c, a) * (180 / Math.PI) + 180) / 90 + 3) % 4; | |
| switch (g) { | |
| case 0: | |
| return "top"; | |
| case 1: |
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
| {% ifequal request.get_host '127.0.0.1:8000' %} | |
| {# Include something only to be executed on "localhost" here. #} | |
| {% else %} | |
| {# Include something only to be executed in production here. #} | |
| {% endifequal %} |
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
| # Configure colors, if available. | |
| if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then | |
| c_reset='\[\e[0m\]' | |
| c_user='\[\e[0;32m\]' | |
| c_path='\[\e[1;34m\]' | |
| c_git_clean='\[\e[0;37m\]' | |
| c_git_staged='\[\e[0;32m\]' | |
| c_git_unstaged='\[\e[0;31m\]' | |
| else | |
| c_reset= |
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
| # Useful if dev settings are pointed at the production or staging database on a remote host | |
| # In the dev settings, after the `DATABASES` configuration, add a second wrapped in an `if` statement | |
| import sys | |
| if 'test' in sys.argv: | |
| DATABASES = { | |
| 'default': { | |
| 'ENGINE': 'django.db.backends.postgresql_psycopg2', |
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
| // requires jQuery | |
| // insert after _gaq is declared but before you talk to Google | |
| // track all clicks on links as events | |
| $('a').click(function(e) { | |
| var debug = false; // if set to true will log instead of calling google | |
| if (this.hostname && this.hostname !== location.hostname) { | |
| var eCat = 'External Link'; | |
| } else { |
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
| {# asdf #} | |
| {# {{ var }} {% if %} ... {% endif %} #} | |
| {{ asdf }} | |
| <script type="text/javascript"> | |
| fruits = new Array('apples', 'oranges', 'bananas'); | |
| for (var i=0; i < fruits.length; i++) { | |
| alert(fruits[i]); |
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
| Setup a new filter in Google Analytics with the following configuration: | |
| Filter Type: Custom Filter | |
| Filter Field: User Defined | |
| Filter Pattern: no_report | |
| Case sensitive No |
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
| input[type="submit"] | |
| +experimental(appearance, none) // safari mobile does funny things |
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
| # Iterates over files and subdirectories in directorie[s] given as arguments | |
| # and adds raw text of those files to merged.txt in the working directory | |
| # where the script is called | |
| # Call like this: | |
| # ruby merge.rb {absolute path portion to delete} {directory to scan} [{directory to scan}] | |
| # For example: | |
| # ruby merge.rb /Users/donnieclapp/Projects/ ~/Projects/htl-website/myproject/static_media/stylesheets | |
| # create or open the merged.txt file for writing (in working directory) |
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
| Single line, no attribution: | |
| <figure class="quote"> | |
| <blockquote>It is the unofficial force—the Baker Street irregulars.</blockquote> | |
| </figure> | |
| Single line, with attribution and optional cite: | |
| <figure class="quote"> | |
| <blockquote>It is the unofficial force—the Baker Street irregulars.</blockquote> |