Skip to content

Instantly share code, notes, and snippets.

View carlosspohr's full-sized avatar

Carlos Spohr carlosspohr

View GitHub Profile
@redoPop
redoPop / .gitignore
Created June 18, 2010 22:08
Template .gitignore file for WordPress projects
# This is a template .gitignore file for git-managed WordPress projects.
#
# Fact: you don't want WordPress core files, or your server-specific
# configuration files etc., in your project's repository. You just don't.
#
# Solution: stick this file up your repository root (which it assumes is
# also the WordPress root directory) and add exceptions for any plugins,
# themes, and other directories that should be under version control.
#
# See the comments below for more info on how to add exceptions for your
@rponte
rponte / c3p0_configuration_pt-BR.properties
Last active August 4, 2022 23:04
c3p0 configuration in portuguese
http://stackoverflow.com/questions/4726512/recover-hibernate-connection
--
http://www.guj.com.br/java/116296-finalizar-conexoes---trabalhando-com-hibernatejpac3p0mysql
### *****************************
### **** Propriedades do C3P0 ***
### *****************************
@hay
hay / gist:1351230
Last active March 29, 2024 16:36
Enterprisify your Java Class Names!
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Enterprisify your Java Class Names! (by Hay Kranen)</title>
<style>
body {
background: white;
text-align: center;
@cmilfont
cmilfont / DirectJavascriptRemote.java
Created December 27, 2011 20:21
Gerar a representação dos controllers do VRaptor em javascript
/* Começado em https://gist.github.com/1524693 */
package org.milfont.indica.controller;
import java.util.Collection;
import java.util.Comparator;
import java.util.List;
import java.util.Set;
import net.vidageek.mirror.dsl.Mirror;
@lucascs
lucascs / ParametersFilter.java
Created June 1, 2012 22:04
Filter for removing blank id parameters
import java.io.IOException;
import java.util.Collections;
import java.util.Enumeration;
import java.util.Map;
import java.util.Map.Entry;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
@sergiy
sergiy / shadow_example.sql
Created July 19, 2012 14:32
online schema change
/*
-- existing table structure, missing index for the field1
CREATE TABLE IF NOT EXISTS `table1` (
`id` int(11) NOT NULL auto_increment,
`field1` int(11) not null,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
*/
anonymous
anonymous / gist:4009042
Created November 3, 2012 22:08
Vraptor UploadedFile - getSize()
public interface UploadedFile {
...
long getSize();
}
public class DefaultUploadedFile implements UploadedFile {
public DefaultUploadedFile(..., long size) {
...
this.size = size;
@aaronzirbes
aaronzirbes / shrink-git-repo.sh
Created January 19, 2013 05:32
This script will help you remove large files from your git repo history and shrink the size of your repository.
#!/bin/bash
echo "Finding and Purging Big Files From Git History"
echo "=============================================="
echo ""
echo "http://naleid.com/blog/2012/01/17/finding-and-purging-big-files-from-git-history/"
echo ""
pushd "$(git rev-parse --show-toplevel)" > /dev/null
@dipold
dipold / MultiTenantProvider.java
Last active May 29, 2024 18:47
Hibernate 4 Multitenancy with postgresql implementation example
package yourpackage.util.hibernate.multitenancy;
import java.sql.Connection;
import java.sql.SQLException;
import java.util.Map;
import org.hibernate.HibernateException;
import org.hibernate.service.config.spi.ConfigurationService;
import org.hibernate.service.jdbc.connections.internal.C3P0ConnectionProvider;
import org.hibernate.service.jdbc.connections.spi.MultiTenantConnectionProvider;
@hgomez
hgomez / mint141516.md
Last active October 23, 2018 14:08
Mint 14 -> Mint 15 -> Mint 16

Mint upgrade procedures

Some investigation and tests on how to upgrade Mint machine.

Tests performed on Mint Cinnamon 14/15/16, on physical machine 14->15 and VirtualBox VMs for 14->15->16 and 14->16.

As usual you could break your machine, so please do backups before and cross fingers.

Mint 14 -> Mint 15