Skip to content

Instantly share code, notes, and snippets.

View anlcan's full-sized avatar
💭
bursting with fruit flavor
💭
bursting with fruit flavor
View GitHub Profile
@anlcan
anlcan / validateTckNo
Created September 27, 2013 12:13
tc kimlik numarasi dogrulama
int * split(const char * word){
int len = strlen(word);
long long number = atoll(word);//[word longLongValue];
int * result = (int*)malloc(len * sizeof(int));
for( --len ; len >= 0; len--){
int rem = number % 10;
@anlcan
anlcan / LogentriesHandler.java
Last active August 29, 2015 13:57
Logentries on Google App Engine
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.*;
import java.net.Socket;
import java.net.SocketAddress;
import java.util.concurrent.locks.Condition;
import java.util.concurrent.locks.Lock;
@anlcan
anlcan / gist:88e61238047b44ead0f6
Created July 25, 2014 12:46
Turkish towns by cityId dictionary
NSDictonary * towns =
@{
@"1":@[@"SEYHAN",
@"CEYHAN",
@"FEKE",
@"KARAİSALI",
@"KARATAŞ",
@"KOZAN",
@"POZANTI",
@"SAİMBEYLİ",
NSString * formatString(NSString * input){
// ### ### ## ##
if ( [input length] > 8){
return [NSString stringWithFormat:@"%@ %@",
formatString([input substringToIndex:8]),
[input substringFromIndex:8]];
} else if ( [input length] > 6){
return [NSString stringWithFormat:@"%@ %@",
formatString([input substringToIndex:6]),
@anlcan
anlcan / web.xml for jersey
Created August 15, 2014 10:23
minimum requirement for javax.servlet container with jersey
<servlet>
<servlet-name>Jersey</servlet-name>
<servlet-class>com.sun.jersey.server.impl.container.servlet.ServletAdaptor</servlet-class>
<init-param>
<param-name>javax.ws.rs.Application</param-name>
<param-value>com.telera.securepayment.rest.PaymentApplication</param-value>
</init-param>
<init-param>
<param-name>com.sun.jersey.config.feature.DisableWADL</param-name>
<param-value>true</param-value>
#!/bin/bash
echo "---------------------------------"
# FIXME : getting version from build *without* PilstBuddy
#VERSION=`/usr/libexec/PlistBuddy -c "Print CFBundleShortVersionString" OdeAlClient/OdeAlClient-Info.plist | tr . -`
VERSION=""
PROTOCOL="https"
PROJECT="odeal"
echo $CONFIGURATION
@anlcan
anlcan / setenv.sh
Created April 25, 2016 13:39
tomcat environment variables
#! /bin/sh
# ==================================================================
# ______ __ _____
# /_ __/___ ____ ___ _________ _/ /_ /__ /
# / / / __ \/ __ `__ \/ ___/ __ `/ __/ / /
# / / / /_/ / / / / / / /__/ /_/ / /_ / /
#/_/ \____/_/ /_/ /_/\___/\__,_/\__/ /_/
# Multi-instance Apache Tomcat installation with a focus
# on best-practices as defined by Apache, SpringSource, and MuleSoft
@anlcan
anlcan / server.xml
Created April 25, 2016 13:42
tomcat cluster example
<!-- place under Host -->
<Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"
channelSendOptions="8">
<Manager className="org.apache.catalina.ha.session.DeltaManager"
expireSessionsOnShutdown="false"
notifyListenersOnReplication="true"/>
<Channel className="org.apache.catalina.tribes.group.GroupChannel">
<Membership className="org.apache.catalina.tribes.membership.McastService"
#!/bin/bash
# set -e # fail if any commands fails
# check if issue has the right format, if it fails, nothing will happen
ISSUE=`echo $1 | grep -io '[[:alpha:]]\+-[[:digit:]]\+'`
echo "using $ISSUE"
## check issue exists on jira
SHOW=`jira show $ISSUE`