This is a fairly common question, and there isn't a One True Answer.
These are the most common techniques:
# robots.txt for wordpress | |
# https://gist.github.com/chuckreynolds/135728 | |
User-agent: * | |
Disallow: /*.php$ | |
Disallow: /cgi-bin/ | |
Disallow: /comment-page-* | |
Disallow: /?s=* | |
Disallow: /search/* | |
Disallow: /trackback/ |
[extensions] | |
# enable color extension | |
color = | |
# enable extdiff extension (Extended Diff) | |
hgext.extdiff = | |
[extdiff] | |
# configure extended diff to use colordiff (requires colordiff installed in your system) | |
cmd.cdiff = colordiff | |
opts.cdiff = -uprN |
# ---------------------------------------------------------- | |
# Configuration for hosting Git repositories with Apache 2.x | |
# ---------------------------------------------------------- | |
# | |
# This setup provides "dual URLS", where URL like <http://git.example.com/my_repository.git> | |
# loads Gitweb in the browser and the same URL can be used in commands like `git clone` and `git remote add`. | |
# It was compiled from some sources on the internet and further customized/tuned. | |
# | |
# Please see documentation for: | |
# |
<?php | |
/** | |
* This is free and unencumbered software released into the public domain. | |
* | |
* Anyone is free to copy, modify, publish, use, compile, sell, or | |
* distribute this software, either in source code form or as a compiled | |
* binary, for any purpose, commercial or non-commercial, and by any | |
* means. | |
* |
@@ -28,7 +28,7 @@ | |
### Set diff-cmd to the absolute path of your 'diff' program. | |
### This will override the compile-time default, which is to use | |
### Subversion's internal diff implementation. | |
-# diff-cmd = diff_program (diff, gdiff, etc.) | |
+diff-cmd = colordiff | |
### Set diff3-cmd to the absolute path of your 'diff3' program. | |
### This will override the compile-time default, which is to use | |
### Subversion's internal diff3 implementation. |
import os | |
def split(filehandler, delimiter=',', row_limit=10000, | |
output_name_template='output_%s.csv', output_path='.', keep_headers=True): | |
""" | |
Splits a CSV file into multiple pieces. | |
A quick bastardization of the Python CSV library. | |
Arguments: |
<?php | |
namespace Acme\DemoBundle\Features\Context; | |
use Behat\BehatBundle\Context\BehatContext, | |
Behat\Behat\Context\TranslatedContextInterface, | |
Behat\Behat\Exception\PendingException; | |
use Behat\Gherkin\Node\PyStringNode, | |
Behat\Gherkin\Node\TableNode; |
#301 Redirects for .htaccess | |
#Redirect a single page: | |
Redirect 301 /pagename.php http://www.domain.com/pagename.html | |
#Redirect an entire site: | |
Redirect 301 / http://www.domain.com/ | |
#Redirect an entire site to a sub folder | |
Redirect 301 / http://www.domain.com/subfolder/ |
<?php | |
/* | |
Plugin Name: Rewrite Rule Tutorials | |
*/ | |
add_action( 'init', 'pmg_rewrite_add_rewrites' ); | |
function pmg_rewrite_add_rewrites() | |
{ | |
add_rewrite_endpoint( 'json', EP_PERMALINK ); | |
add_rewrite_rule( |