Models | Examples |
---|---|
Display ads | Yahoo! |
Search ads |
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
<?php | |
//loop to fetch members | |
function parse_data($str_to_array, $key = '', $value = '', $output_data = array()){ | |
foreach($str_to_array as $item){ | |
if(!is_numeric($item)){ | |
//check for values | |
if(!empty($key) && !empty($value)){ | |
$output_data[$key] = $value; | |
parse_data($str_to_array, '', '', $output_data); | |
} else { |
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
import re, web, urlparse | |
def correct_case(text): | |
return ' '.join(['%s.' % x.strip().capitalize() for x in re.split('\.', text) if x]) | |
urls = ( | |
'/api/correct_case','CaseService' | |
) | |
app = web.application(urls, globals()) |
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
if settings.TWITTER_INTEGRATION_ENABLED: | |
js_files.append('components/twitter.js') | |
if settings.GITHUB_INTEGRATION_ENABLED: | |
js_files.append('components/github.js') | |
if settings.DRIBBBLE_INTEGRATION_ENABLED: | |
js_files.append('components/dribbble.js') | |
if settings.INSTAGRAM_INTEGRATION_ENABLED: |
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
# The first Django site to run on Python 3! | |
# Copyright (c) 2012 Aymeric Augustin | |
# License: https://github.com/django/django/blob/master/LICENSE | |
import os | |
import sys | |
import django | |
from django.conf.urls.defaults import patterns | |
from django.http import HttpResponse, HttpResponseNotFound, HttpResponseServerError |
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
""" 1) Download python twitter library from https://github.com/sixohsix/twitter | |
2) Go to dev.twitter.com creaate an application and genenrate tokens | |
3) Setup your tokens below | |
4) python cleanup.py and your tweets are gone! | |
""" | |
from twitter import * | |
t = Twitter( | |
auth=OAuth('--your-access-token-here', |
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
h1. The Plan | |
The plan is to make the next generation of WebCore into something greater -- something beyond the current web frameworks. Something that web functionality is just one part of. A service component framework that facilitates modularity and code reuse. | |
h1. Sources of Inspiration | |
Some existing projects can be used as sources of inspiration for the design of this component framework. Those include: | |
* "Jenkins":http://jenkins-ci.org/ for its web interface and plugin system | |
* "Mule":http://www.mulesoft.org/ and "Apache ServiceMix":https://servicemix.apache.org/ as the leading open source ESBs in the world |
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
def __unicode__(self): | |
try: | |
return '{0}'.format(self.name) | |
except UnicodeError: | |
return '' |
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
""" | |
The MIT License (MIT) | |
Copyright (c) 2011 Numan Sachwani | |
Permission is hereby granted, free of charge, to any person obtaining a copy of | |
this software and associated documentation files (the "Software"), to deal in | |
the Software without restriction, including without limitation the rights to | |
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies | |
of the Software, and to permit persons to whom the Software is furnished to do | |
so, subject to the following conditions: |
Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)
That's it!
OlderNewer