View sql-variables.txt
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
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 | | |
+---------+--------+-------+ |
View move-wordpress.sql
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
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); |
View config.rb
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
# Customize according to your needed configuration | |
set :application, "Application Name" | |
set :repository, "git@github.com:user/repo.git" | |
set :db_repository, 'git@github.com: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" |
View MyObject.groovy
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
package myapp.mypackage | |
/** | |
* Just an example of a domain class. | |
* @author andrezrv | |
*/ | |
class MyObject { | |
String name |
View MyBuildTestData.groovy
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
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 ) |
View wordpress-admin-notice.php
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 | |
/** | |
* Displays a notice in the admin section under some condition. | |
* | |
* @author andrezrv | |
*/ | |
function my_admin_notice() { | |
global $current_screen; |
View wp-config-no-autoupdates-example.php
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 | |
# Disables all kind of file modifications: | |
# core, plugins and themes won't be auto-updated | |
# and file editors won't appear anymore in wp-admin. | |
define( 'DISALLOW_FILE_MODS', true ); | |
# Disables all core updates: | |
define( 'WP_AUTO_UPDATE_CORE', false ); |
View new-user.sql
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
GRANT ALL PRIVILEGES ON %DB_NAME%.* TO %DB_USER%@%DB_HOST% IDENTIFIED BY '%DB_PASSWORD%'; |
View varnish-purge-cache.sh
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
# Purge all Varnish cache | |
varnishadm "ban req.url ~ /" |
View nginx-common.conf.c
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
#server { | |
# listen 80; | |
# root /srv/www/mysite; | |
index index.php index.html index.htm; | |
# server_name www.mysite.com; | |
location / { | |
try_files $uri $uri/ /index.html; | |
} |
OlderNewer