Skip to content

Instantly share code, notes, and snippets.

View yamanyar's full-sized avatar

Kaan Yamanyar yamanyar

View GitHub Profile
#!/bin/bash
# Pre recieve tests
NOREV=0000000000000000000000000000000000000000
while read oldsha newsha refname ; do
# deleting is always safe
if [[ $newsha == $NOREV ]]; then
continue
fi
@yamanyar
yamanyar / ornek.xml
Created April 2, 2012 07:35
Dışarıdaki bir WS'e giden
<int:channel id="clientService"/>
<chain input-channel="clientService">
<!-- kullanacağımız servis soap-action isteseydi; burada yer alacaktı.
<ws:header-enricher>
<ws:soap-action value=""/>
</ws:header-enricher>-->
<ws:outbound-gateway uri="http://mygreatserver.yamanyar.com:9082/services/GreatService" />
</chain>
@yamanyar
yamanyar / ornek2.xml
Created April 2, 2012 07:41
Logging Eklenmiş Hali
<int:channel id="clientService">
<int:interceptors>
<int:wire-tap channel="loggingChannel"/>
</int:interceptors>
</int:channel>
<int:logging-channel-adapter id="loggingChannel" level="INFO"
expression="'Message received : '.concat(payload.toString())"/>
<chain input-channel="clientService">
@yamanyar
yamanyar / ornek3.xml
Created April 2, 2012 07:52
Transformer Eklenmiş Hali
<int:channel id="clientService">
<int:interceptors>
<int:wire-tap channel="xmlLoggingChannel"/>
</int:interceptors>
</int:channel>
<int:channel id="xmlLoggingChannel"/>
<int:transformer input-channel="xmlLoggingChannel" output-channel="loggingChannel">
<beans:bean class="com.yamanyar.si.transformers.DomSourceToStringNoErrorTransformer"/>
package com.yamanyar.si.transformers.DomSourceToStringNoErrorTransformer;
import org.apache.log4j.Logger;
import org.springframework.integration.Message;
import org.springframework.integration.support.MessageBuilder;
import org.springframework.integration.transformer.Transformer;
import javax.xml.transform.OutputKeys;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.dom.DOMSource;
@yamanyar
yamanyar / log4j.xml
Created April 3, 2012 12:35
Sample properties file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
<!-- Appenders -->
<appender name="console" class="org.apache.log4j.ConsoleAppender">
<param name="Target" value="System.out"/>
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%-5p: %c - %m%n"/>
</layout>
@yamanyar
yamanyar / logging.xml
Created April 3, 2012 12:25
Spring WS Logging Req/Res
<?xml version="1.0" encoding="UTF-8"?>
<beans:beans xmlns="http://www.springframework.org/schema/integration"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:beans="http://www.springframework.org/schema/beans"
xmlns:ws="http://www.springframework.org/schema/integration/ws"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/integration/ws
http://www.springframework.org/schema/integration/ws/spring-integration-ws.xsd">
<ws:interceptors>
@yamanyar
yamanyar / tempale.html
Created April 5, 2012 14:13
JS Template
<b>Hello</b> {name}! You have {count} new messages.
{
"name": "Mick",
"count": 30
}
@yamanyar
yamanyar / sample.py
Created April 7, 2012 05:07
resolving in python
#!/usr/bin/python
# Rewrite URL Script for Secure Web Issue
# author: Kaan Yamanyar
from Crypto.Cipher import DES
from datetime import datetime, timedelta
import sys
import re
import base64
def parseToken(str):