What do you want to save?
Add Code snippet
New code examples
-
Javascript 2021-09-25 08:39:02
defer parsing of javascript wordpress
// Only for Javascript function defer_parsing_of_js( $url ) { if ( is_user_logged_in() ) return $url; //don't break WP Admin if ( FALSE === strpos( $url, '.js' ) ) return $url; if ( strpos( $url, 'jquery.js' ) ) return $url; return str_re... Add solution -
PHP 2021-09-15 19:56:03
how to create config file in php
<?php return (object) array( 'host' => 'localhost', 'username' => 'root', 'pass' => 'password', 'database' => 'db' ); ?> This allows you to use the object syntax when you include the php : $configs->host instead o... Add solution -
Javascript 2021-09-05 23:53:03
sinon js
Sinon provides standalone test spies, stubs and mocks for JavaScript. It works with any unit testing framework. Spy -> Monitoring and verifying function behaviour Stub -> Modify function behaviour / Replace difficult to test code Mock -> Fake me... Add solution