This file contains hidden or 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 | |
/** | |
* Displays a notice in the admin section under some condition. | |
* | |
* @author andrezrv | |
*/ | |
function my_admin_notice() { | |
global $current_screen; |
This file contains hidden or 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
package myapp.downloads | |
import grails.test.mixin.TestFor | |
import spock.lang.Specification | |
import grails.buildtestdata.mixin.Build | |
/** | |
* See the API for {@link grails.test.mixin.support.GrailsUnitTestMixin} for usage instructions | |
*/ | |
@TestFor( Download ) |
This file contains hidden or 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
package myapp.mypackage | |
/** | |
* Just an example of a domain class. | |
* @author andrezrv | |
*/ | |
class MyObject { | |
String name |
This file contains hidden or 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
# Customize according to your needed configuration | |
set :application, "Application Name" | |
set :repository, "[email protected]:user/repo.git" | |
set :db_repository, '[email protected]:user/repo-db.git' | |
set :scm, :git | |
# Or: `accurev`, `bzr`, `cvs`, `darcs`, `git`, `mercurial`, `perforce`, `subversion` or `none` | |
# This assumes you're using Git. Needed to run tasks in db-tasks.rb | |
set :git_user_name, "user" |
This file contains hidden or 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
SELECT @old_domain := 'http://www.old-domain.com' , @new_domain := 'http://www.new-domain.com'; | |
UPDATE wp_options SET option_value = replace(option_value, @old_domain, @new_domain) WHERE option_name = 'home' OR option_name = 'siteurl'; | |
UPDATE wp_posts SET guid = replace(guid, @old_domain, @new_domain); | |
UPDATE wp_posts SET post_content = replace(post_content, @old_domain, @new_domain); |
This file contains hidden or 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
mysql> SELECT @min_price:=MIN(price),@max_price:=MAX(price) FROM shop; | |
mysql> SELECT * FROM shop WHERE price=@min_price OR price=@max_price; | |
+---------+--------+-------+ | |
| article | dealer | price | | |
+---------+--------+-------+ | |
| 0003 | D | 1.25 | | |
| 0004 | D | 19.95 | | |
+---------+--------+-------+ |
NewerOlder