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
#Deploy and rollback on Heroku in staging and production | |
task :deploy_staging => ['deploy:set_staging_app', 'deploy:push', 'deploy:restart', 'deploy:tag'] | |
task :deploy_production => ['deploy:set_production_app', 'deploy:push', 'deploy:restart', 'deploy:tag'] | |
namespace :deploy do | |
PRODUCTION_APP = 'YOUR_PRODUCTION_APP_NAME_ON_HEROKU' | |
STAGING_APP = 'YOUR_STAGING_APP_NAME_ON_HEROKU' | |
task :staging_migrations => [:set_staging_app, :push, :off, :migrate, :restart, :on, :tag] | |
task :staging_rollback => [:set_staging_app, :off, :push_previous, :restart, :on] |
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
## Prepare ################################################################### | |
# Remove RVM | |
rvm implode | |
# Ensure your homebrew is working properly and up to date | |
brew doctor | |
brew update | |
## Install ################################################################### |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
<modelVersion>4.0.0</modelVersion> | |
<groupId>com.example</groupId> | |
<artifactId>my-project</artifactId> | |
<version>0.0.1-SNAPSHOT</version> | |
<dependencies> | |
<!-- none yet --> |
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
config.middleware.insert_before(0, 'Rack::SeoRedirect') |
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
#################################### | |
# BASIC REQUIREMENTS | |
# http://graphite.wikidot.com/installation | |
# http://geek.michaelgrace.org/2011/09/how-to-install-graphite-on-ubuntu/ | |
# Last tested & updated 10/13/2011 | |
#################################### | |
cd | |
sudo apt-get update | |
sudo apt-get upgrade |
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
Instructions | |
1. Add MY_url_helper.php to CI_directory/application/helpers | |
2. If the CI app is already built, convert any references to *site_url* in your CI application (aside from the system directory) to the new namespaced function, ci_site_url. | |
This step prevents Wordpress' site_url function from overwriting CIs. Because both functions are global and CI checks to make sure that site_url has not been set. Once we load the WP bootstrap file, it will have been defined, so CI's function wll never load. | |
3. Add Wordpress' bootstrap file into CI_directory/index.php right above CI's bootstrap file. | |
4. Update wp-includes/load.php *(this is necessary if you are using CI's sessions - Wordpress mangles CI's cookies using with magic quotes. (There may be an upgrade-proof way to do this.) |
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
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 logging | |
import multiprocessing | |
import time | |
import mplog | |
FORMAT = '%(asctime)s - %(processName)s - %(levelname)s - %(message)s' | |
logging.basicConfig(level=logging.DEBUG, format=FORMAT) | |
existing_logger = logging.getLogger('x') |
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
# db/migrate/XXXXXXXXXXXXX_add_authentication_token_to_users.rb | |
class AddAuthenticationTokenToUsers < ActiveRecord::Migration | |
def change | |
add_column :users, :authentication_token, :string | |
add_index :users, :authentication_token, :unique => true | |
end | |
end |
OlderNewer