Skip to content

Instantly share code, notes, and snippets.

View jasoet's full-sized avatar
🎯
Focusing

Deny Prasetyo jasoet

🎯
Focusing
View GitHub Profile
@jasoet
jasoet / gist:870228
Created March 15, 2011 02:48
persistence
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"
version="2.0">
<persistence-unit name="galleryPersistenceUnit" transaction-type="RESOURCE_LOCAL">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<validation-mode>NONE</validation-mode>
<properties>
@jasoet
jasoet / gist:970186
Created May 13, 2011 08:12
Spring Application Context
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:util="http://www.springframework.org/schema/util" xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:jee="http://www.springframework.org/schema/jee" xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context
(function() {
var http, jsdom, options, req, sys, url;
jsdom = require('jsdom');
sys = require('sys');
http = require('http');
url = 'http://www.bigoven.com/recipes/search?any_kw=salad';
options = {
host: 'www.bigoven.com',
port: 80,
path: '/recipes/search',
>+++++++++[<++++++++>-]<.>+++++++[<++++>-]<+.+++++++..+++.>>>++++++++[<++++>-]
<.>>>++++++++++[<+++++++++>-]<---.<<<<.+++.------.--------.>>+.
CREATE SEQUENCE category_category_id_seq_1;
CREATE TABLE category (
category_id INTEGER NOT NULL DEFAULT nextval('category_category_id_seq_1'),
name VARCHAR(55) NOT NULL,
CONSTRAINT category_id PRIMARY KEY (category_id)
);
@jasoet
jasoet / gist:3843510
Created October 6, 2012 02:31
Insert Data
INSERT INTO category (category_id,"name") VALUES (1,'Electronics');
INSERT INTO category (category_id,"name") VALUES (2,'Car');
INSERT INTO category (category_id,"name") VALUES (3,'Computer');
INSERT INTO category (category_id,"name") VALUES (4,'Handphone');
INSERT INTO product ("name",description,price,expireddate,category_id) VALUES ('Infocus','',399,'2014-09-04',1);
INSERT INTO product ("name",description,price,expireddate,category_id) VALUES ('Lenovo','',399,'2015-01-04',3);
INSERT INTO product ("name",description,price,expireddate,category_id) VALUES ('Honda','',399,'2016-08-04',2);
INSERT INTO product ("name",description,price,expireddate,category_id) VALUES ('HTC EVO 4G','',399,'2013-02-04',4);
INSERT INTO product ("name",description,price,expireddate,category_id) VALUES ('Fujitsu','',399,'2014-06-04',3);
@jasoet
jasoet / gist:3843797
Created October 6, 2012 04:16
Database Connection Singleton
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package org.secondstack.db;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
@jasoet
jasoet / gist:3844362
Created October 6, 2012 08:07
Sample ProductDAOImpl
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package org.secondstack.dao.impl;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
@jasoet
jasoet / gist:4064028
Created November 13, 2012 05:10
ExceptionHandler
/**
* Deny Prasetyo, S.T.
* jasoet87@gmail.com
* [at] jasoet
* github.com/jasoet
* bitbucket.org/jasoet
*/
public abstract class BaseExceptionHandler extends BaseLogHelper {
@jasoet
jasoet / gist:4064739
Created November 13, 2012 09:00
Serialize Deserialize
/**
* Created by Deny Prasetyo,S.T
* Java(Script) and Rails Developer
* jasoet87@gmail.com
* <p/>
* http://github.com/jasoet
* http://bitbucket.com/jasoet
*
* @jasoet
*/