Skip to content

Instantly share code, notes, and snippets.

View mintster's full-sized avatar

Dave Burke mintster

  • Burlington, Vermont
View GitHub Profile
@dharma017
dharma017 / wp-db-migrate.md
Created September 14, 2015 12:43
Wordpress DB Migration

Wordpress DB Migration

Normal Site Tables

UPDATE `wp_commentmeta` SET `meta_value` = replace(meta_value, 'http://olddomain.com', 'http://newdomain.com');
UPDATE `wp_comments` SET `comment_content` = replace(comment_content, 'http://olddomain.com', 'http://newdomain.com');
UPDATE `wp_options` SET `option_value` = replace(option_value, 'http://olddomain.com', 'http://newdomain.com');
UPDATE `wp_posts` SET `post_content` = replace(post_content, 'http://olddomain.com', 'http://newdomain.com');
UPDATE `wp_posts` SET `guid` = replace(guid, 'http://olddomain.com', 'http://newdomain.com');
@chrisbanes
chrisbanes / CollapsingTitleLayout.java
Last active March 26, 2023 11:58
CollapsingTitleLayout
/*
* Copyright 2014 Chris Banes
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@mismatch
mismatch / JpaRepositoriesConfig.java
Created August 10, 2014 06:45
Spring Boot. Multiple DB repositories configuration example
import java.util.Map;
import javax.sql.DataSource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.autoconfigure.orm.jpa.EntityManagerFactoryBuilder;
import org.springframework.boot.autoconfigure.orm.jpa.JpaProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan.Filter;
@jesperdj
jesperdj / Example01.java
Last active February 10, 2018 03:19
Examples with Java 8 lambda expressions.
package org.jesperdj.lambda;
import java.util.ArrayList;
import java.util.List;
public class Example01 {
// Using a for-loop (external iteration)
public Iterable<String> getBestStudentsOfYear(Iterable<Student> students, int year) {
List<String> result = new ArrayList<>();
@witscher
witscher / tomcat.conf
Created June 13, 2012 13:24
Apache Tomcat Upstart script
description "Tomcat Server"
start on runlevel [2345]
stop on runlevel [!2345]
respawn
respawn limit 10 5
# run as non privileged user
# add user with this command:
## adduser --system --ingroup www-data --home /opt/apache-tomcat apache-tomcat