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
| """ | |
| Here's my sample Django settings for a project I recently did. Visit http://damonjablons.wordpress.com to see the explanation. | |
| """ | |
| import os | |
| import socket | |
| # Set DEBUG = True if on the production server | |
| if socket.gethostname() == 'your.domain.com': | |
| DEBUG = False |
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
| """ | |
| Here's my sample Django settings for a project I recently did. Visit http://damonjablons.wordpress.com to see the explanation. | |
| """ | |
| import os | |
| import socket | |
| # Set DEBUG = True if on the production server | |
| if socket.gethostname() == 'your.domain.com': | |
| DEBUG = False |
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
| from django.conf import settings | |
| from django.template import add_to_builtins | |
| import django.template.loader | |
| try: | |
| for lib in settings.TEMPLATE_TAGS: | |
| add_to_builtins(lib) | |
| except AttributeError: | |
| pass |
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 init_map() { | |
| var places = [ | |
| { name: "Place 1", coords: new google.maps.LatLng(30.728752, -73.995525)}, | |
| { name: "Place 2", coords: new google.maps.LatLng(30.733673, -73.990028)}, | |
| { name: "Place 3", coords: new google.maps.LatLng(40.725778, -73.992249)} | |
| ] | |
| var myOptions = { | |
| zoom: 14, | |
| center: places[0].coords, |
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 init_map() { | |
| var places = [ | |
| { name: "Place 1", coords: new google.maps.LatLng(30.728752, -73.995525)}, | |
| { name: "Place 2", coords: new google.maps.LatLng(30.733673, -73.990028)}, | |
| { name: "Place 3", coords: new google.maps.LatLng(40.725778, -73.992249)} | |
| ] | |
| var myOptions = { | |
| zoom: 14, | |
| center: places[0].coords, |
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
| #!/usr/bin/env python | |
| from measurments.abstract import SPRINKLE | |
| from delicious import GOOD | |
| def mix_ingredients(ingredients): | |
| mixture = [] | |
| for key in ingredients.iterkeys(): | |
| mixture.append("%s: %s" % (key, ingredients[key])) |
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
| egg_nog = { | |
| 'egg_yolks': 12, | |
| 'lbs_sugar': 1, | |
| 'cups_rum': 2, | |
| 'cups_bourbon': 2, | |
| 'quarts_whipping_cream': 2, | |
| 'egg_whites': 12, | |
| 'nutmeg': 'sprinkle', | |
| } |
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
| webhost1:~# /usr/sbin/useradd -o -u 0 hope | |
| Adding user `hope' ... | |
| Adding new group `hope' (1001) ... | |
| Adding new user `hope' (1001) with group `hope' ... | |
| Creating home directory `/home/hope' ... | |
| Copying files from `/etc/skel' ... | |
| Password: dragostea mea pentru | |
| Password again: dragostea mea pentru | |
| Changing the user information for hope |
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
| <VirtualHost *:80> | |
| ServerName acm25-9.acm.org | |
| <Directory /var/www/vhosts/pubs/ciedev/html/ > | |
| Order deny,allow | |
| Allow from all | |
| </Directory> | |
| ### You can uncomment the next three lines to partition logs for this site, just change the log paths. | |
| # LogLevel warn |
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
| >>> import requests # http://python-requests.org | |
| >>> headers = {'User-Agent': "Public App ID Goes Here/1.0", 'X-PAPPID': "private.app.id.goes.here"} | |
| >>> response = requests.get('http://10.0.23.10:9630/api/invoices/', headers=headers, auth=("username", "password")) | |
| # Or for a post, just change the .get to a .post/.put/.delete ... | |
| >>> data = {'here': "is", 'my': "data", 'for': "posting"} | |
| >>> response = requests.post('http://10.0.23.10:9630/api/invoices/', data=data, headers=headers, auth=("username", "password")) | |
| # Now to decode the response xml to python | |
| >>> from BeautifulSoup import BeautifulStoneStoup as BSS |
OlderNewer