Skip to content

Instantly share code, notes, and snippets.

@pascaldimassimo
pascaldimassimo / DataSourceConfig.java
Last active November 26, 2020 15:41
Spring Boot config for multiple datasources and EntityManagerFactories
package com.pascaldimassimo.xyz;
import java.util.HashMap;
import java.util.Map;
import javax.persistence.EntityManagerFactory;
import javax.sql.DataSource;
import org.hibernate.cfg.ImprovedNamingStrategy;
import org.springframework.beans.factory.annotation.Autowired;
@andreazevedo
andreazevedo / install_mono.sh
Last active November 12, 2021 02:51
Install mono on centOS 6.x
$ yum install bison gettext glib2 freetype fontconfig libpng libpng-devel libX11 libX11-devel glib2-devel libgdi* libexif glibc-devel urw-fonts java unzip gcc gcc-c++ automake autoconf libtool make bzip2 wget
$ cd /usr/local/src
$ wget http://download.mono-project.com/sources/mono/mono-3.2.8.tar.bz2
$ tar jxf mono-3.2.8.tar.bz2
$ cd mono-3.2.8
<?php
try
{
include 'C:\Program Files\OSGEO\mapguide\www\mapadmin/constants.php';
$locale = "en"; // localizable string
$errorMsg = "";
// Initialize web tier with the site configuration file. The config
@henriquegogo
henriquegogo / easyRoutes.js
Last active December 27, 2018 04:37
Easy routes with javascript and hash
(function() {
var Router = function(routes) {
var hash;
var splitParams = function() {
for (route in routes) {
var routeRegex = "^" + route.replace(/:([A-z0-9_-]*)/g, "([A-z0-9_-]*)") + "(/?)$";
var callRoute = routes[route];
var matches = new RegExp(routeRegex).exec(hash);
@elivz
elivz / wordpress-w3tc-site.conf
Created March 20, 2011 18:06
Nginx configuration for WordPress with W3 Total Cache plugin. See http://elivz.com/blog/single/wordpress_with_w3tc_on_nginx/
server {
# Redirect yoursite.com to www.yoursite.com
server_name yoursite.com;
rewrite ^(.*) http://www.yoursite.com$1 permanent;
}
server {
# Tell nginx to handle requests for the www.yoursite.com domain
server_name www.yoursite.com;