
sharing the power of code

sharing the power of code
Category Frameworks
Delay a Grails controller’s response
Sometimes, for testing or development, you need to slow down an ajax response from the server. In the Grails framework, to delay a controller’s response, do the following: In the action you want to delay, insert: Thread.sleep(5000) as in: def…
Insert HTML after every Nth comment: use the “end-callback” argument
I did not find any examples of using WordPress’s “end-callback” argument for “wp_list_comments”. It is documented by WordPress here. Here is an example of how to use it in child-theme code to add custom HTML after each top level comment.…
WordPress Security: How to change the WordPress database prefix
This is an example of ‘security through obscurity‘. This assumes you’ve already installed WordPress. Backup DB Make a backup of your WordPress database. Edit wp-config.php Edit this line in file wp-config.php: $table_prefix = ‘wp_’; so that ‘wp_’ has some short…
When Making a Directive for AngularJS
Worth Reading: Especially this at the very bottom of that page: By ‘expose an API’, they mean ‘add some this.doSomething() {…} functions to the controller that are reachable from outside the controller’. Like public class methods. If you’re not…
Error starting Grails: com/springsource/loaded/ri/ReflectiveInterceptor
If you are getting this error when trying to start a Grails Project in Intellij: Error starting Grails: com/springsource/loaded/ri/ReflectiveInterceptor try deleting the ./.slcache folder at the top level of your project: projectname/.slcache This problem came when I was trying to…