Skip to content

Instantly share code, notes, and snippets.

View madgrk's full-sized avatar

Ioannis Angelis madgrk

View GitHub Profile
@danlangford
danlangford / build.xml
Created November 18, 2011 21:03
an example of a simple ant/ivy templates w/sitebricks and jetty i like to start with
<?xml version="1.0" encoding="UTF-8"?>
<project name="AntTmplt" xmlns:ivy="antlib:org.apache.ivy.ant" default="run" basedir=".">
<target name="all" depends="setup,resolve" description="Build, compile, and package the entire application">
<!-- Now we compile and package our project. -->
<antcall target="compile"/>
<antcall target="package" />
</target>
@daemonza
daemonza / haproxy.cfg
Created March 6, 2012 07:57
HAproxy virtual site load balancing
# This configuration use acl's to distinguish between url's passwd and then route
# them to the right backend servers. For the backend servers to handle it correctly, you
# need to setup virtual hosting there as well, on whatever you use, tomcat, nginx, apache, etc.
# For this to work with SSL, put pound before HAproxy and use a configuration file similar to
# https://gist.github.com/1984822 to get it working
global
log 127.0.0.1 local0
log 127.0.0.1 local1 info
maxconn 4096
<?php
/**
* PDO SINGLETON CLASS
*
* @author Tony Landis
* @link http://www.tonylandis.com
* @license Use how you like it, just please don't remove or alter this PHPDoc
*/
class sdb
@kui
kui / README.md
Created June 13, 2012 06:34
Eclipse Shortcut for Ubuntu

Eclipse Shortcut for Ubuntu Unity

a shortcut to run Eclipse on Ubuntu Unity and to register Eclipse with the left Launcher

Installation

@smithh032772
smithh032772 / Users.java
Created November 23, 2012 11:58
Users table structure and entity class
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package jpa.entities;
import java.io.Serializable;
import java.util.Collection;
import java.util.Date;
import javax.persistence.*;
@berlinbrown
berlinbrown / gist:4171310
Created November 29, 2012 19:36
POST xml BODY WITH Apache Http client libraries
/*
* Sending a HTTP post BODY with java
* Uses apache http client libraries.
*
* Berlin Brown
*/
import java.io.InputStream;
import java.io.Serializable;
import java.security.KeyStore;
import java.security.cert.X509Certificate;
@NKjoep
NKjoep / current-year.jsp
Created December 20, 2012 10:00
print out the current year within a jsp
<%-- version1: java style --%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@page import="java.util.Date"%>
<%@page import="java.util.Calendar"%>
<% pageContext.setAttribute("currentYear", java.util.Calendar.getInstance().get(java.util.Calendar.YEAR)); %>
Current year is: <c:out value="${currentYear}" />
<%-- version2: JSTL style --%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
@manute
manute / gist:5451435
Last active October 25, 2023 19:28
my zsh config with oh-my-zsh
# Path to your oh-my-zsh configuration.
ZSH=$HOME/.oh-my-zsh
#JAVA_HOME
export JAVA_HOME=`/usr/libexec/java_home -v 1.7`
#MAVEN
export M2_HOME=/usr/local/maven-3.0.5
export MAVEN_OPTS=-Xmx1024m
@fcamblor
fcamblor / gist:5966126
Last active November 22, 2021 11:07
pom.xml file skeleton
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>MYGROUP</groupId>
<artifactId>MYARTIFACT</artifactId>
<version>0.1-SNAPSHOT</version>
<packaging>jar</packaging>
@joey-qc
joey-qc / TSQL-to-POCO
Created September 26, 2013 06:56
A simple TSQL script to quickly generate c# POCO classes from SQL Server tables and views. You may tweak the output as needed. Not all datatypes are represented but this should save a bunch of boilerplate coding. USAGE: Run this query against the database of your choice. The script will loop through tables, views and their respective columns. Re…
declare @tableName varchar(200)
declare @columnName varchar(200)
declare @nullable varchar(50)
declare @datatype varchar(50)
declare @maxlen int
declare @sType varchar(50)
declare @sProperty varchar(200)
DECLARE table_cursor CURSOR FOR