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
# Docker Container Restart Rule | |
Description: | |
This rule directs the AI to provide guidance for restarting Docker containers instead of suggesting direct docker commands. When a container restart is needed, the AI must indicate which container (based on the Dockerfile context) should be restarted and leave the manual execution to the user. Additionally, the AI should verify context to avoid incorrect suggestions such as "npm run dev" when the service is actually running inside a Docker container. | |
Guidelines: | |
Restart Relevant Docker Containers: | |
Analyze the Dockerfile to determine which container(s) are relevant for the current service. |
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
# Production-Quality Rule: No Mock Data or Temporary Solutions | |
This rule mandates that all generated code must be fully production-ready. No mock data, placeholder values, or temporary quick-fix solutions are allowed. If a complete and robust solution isn’t achievable, the system must instead produce an error so that the issue can be addressed properly. | |
No Mock Data: | |
- Do not generate or include any mock data or dummy values in any code or example. | |
- All data should reflect real-world, applicable scenarios. | |
No Temporary Solutions: | |
- Avoid any hacky, provisional, or quick-fix implementations solely to get a server or app running. |
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
/* | |
Usage | |
import {useExcerpt} from '../../hooks/useExcerpt' | |
1. | |
Import or store long text in a variable | |
const text = 'some really long text' | |
2. |
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
function flatten(ary) { | |
var ret = []; | |
for(var i = 0; i < ary.length; i++) { | |
if(Array.isArray(ary[i])) { | |
ret = ret.concat(flatten(ary[i])); | |
} else { | |
ret.push(ary[i]); | |
} | |
} | |
return ret; |
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
//Replace the default WordPress jQuery script with a different one | |
function modify_jquery() { | |
if (!is_admin()) { | |
wp_deregister_script('jquery'); | |
wp_register_script('jquery', 'https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.min.js', false, '1.11.3'); | |
wp_enqueue_script('jquery'); | |
} | |
} |
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
<link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); echo '?' . filemtime( get_stylesheet_directory() . '/style.css'); ?>" type="text/css" media="screen" /> |
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
UPDATE wp_posts SET post_content=(REPLACE (post_content, '<old url>','<new url>')); | |
/* Replace old image permalinks (for content) in wp_posts table for WORDPRESS */ | |
/* Example: | |
UPDATE wp_posts SET post_content=(REPLACE (post_content, 'inmotiontesting.com','test.inmotiontesting.com')); | |
*/ |
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 the_post_thumbnail_url(); ?> |
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
// Offset posts by adding offset=1 | |
<?php global $query_string; // required | |
$posts = query_posts($query_string.'&posts_per_page=7&order=DESC'); ?> | |
<?php while(have_posts()) : the_post(); ?> | |
<div id="post"> | |
<h1><?php the_title(); ?></h1> | |
<p style="font-weight: 300;"><?php the_time('F jS, Y'); ?> // |
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
// Shortcode in functions.php | |
function caption_shortcode( $atts, $content = null ) { | |
return '<span class="caption">' . $content . '</span>'; | |
} | |
add_shortcode( 'caption', 'caption_shortcode' ); | |
// When used like this | |
[caption]My Caption[/caption] | |
// The output would be |
NewerOlder