Example: Apache
# rewrite`s rules for wordpress pretty url
LoadModule rewrite_module modules/mod_rewrite.so
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php [NC,L]
ExpiresActive On
ExpiresByType application/x-javascript "access plus 1 days"
Order Deny,Allow
Allow from All
<Location /maps/>
RewriteMap map txt:map.txt
RewriteMap lower int:tolower
RewriteCond %{REQUEST_URI} ^/([^/.]+)\.html$ [NC]
RewriteCond ${map:${lower:%1}|NOT_FOUND} !NOT_FOUND
RewriteRule .? /index.php?q=${map:${lower:%1}} [NC,L]
</Location>
Example: .htaccess
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
Example: SQL
BEGIN;
CREATE TABLE "topic" (
"id" serial NOT NULL PRIMARY KEY,
"forum_id" integer NOT NULL,
"subject" varchar(255) NOT NULL
);
ALTER TABLE "topic" ADD CONSTRAINT forum_id FOREIGN KEY ("forum_id") REFERENCES "forum" ("id");
-- Initials
insert into "topic" ("forum_id", "subject") values (2, 'D''artagnian');
select count(*) from cicero_forum;
-- this line lacks ; at the end to allow people to be sloppy and omit it in one-liners
COMMIT
Example: JSON
[
{
"title": "apples",
"count": [12000, 20000],
"description": {
"text": "...",
"sensitive": false
}
},
{
"title": "oranges",
"count": [17500, null],
"description": {
"text": "...",
"sensitive": false
}
},
{
"color_scheme": "Packages/User/HUG.tmTheme",
"detect_slow_plugins": false,
"font_size": 12.0,
"ignored_packages":
[
"Vintage",
"AdvancedNewFile"
],
"scroll_past_end": true,
"theme": "Refined-Dark.sublime-theme",
"trim_trailing_white_space_on_save": true
}
]
Example: XML
<?xml version="1.0"?>
<response value="ok" xml:lang="en">
<text>Ok</text>
<comment html_allowed="true"/>
<ns1:description><![CDATA[
CDATA is <not> magical.
]]></ns1:description>
<a></a> <a/>
<dict>
<key>name</key>
<string>JSON String</string>
<key>scope</key>
<string>meta.structure.dictionary.json string.quoted.double.json</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#CFCFC2</string>
</dict>
</dict>
</response>
Example: HTML
<!DOCTYPE html>
<html>
<head>
<title>Title</title>
<style>body {width: 500px;}</style>
<script type="application/javascript">
jQuery(document).ready(function($){
function init() {
return true;
}
keyword.each(function( i,e ){
// console.log('here');
if ( $(this).text() == 'var' ) {
$(this).html( '<span class="var">var</span>' )
}
});
});
</script>
</head>
<body>
<p checked class="title" id='title'>Title</p>
<!-- here goes the rest of the page -->
</body>
</html>
WP: Plugins: Get Custom Post Type Template
/**
* get_template
*
* @since 0.1
*/
function get_custom_post_type_template( $template ) {
global $post;
if ( $post->post_type == 'my_post_type' ) {
$template = dirname( __FILE__ ) . '/post-type-template.php';
}
return $template;
}
add_filter( 'template_include', 'get_custom_post_type_template' );
/* more filters (from http://codex.wordpress.org/Template_Hierarchy)
archive_template
author_template
category_template
tag_template
taxonomy_template
date_template
home_template
front_page_template
page_template
paged_template
search_template
single_template
attachment_template
*/