Skip to content

Instantly share code, notes, and snippets.

This file has been truncated, but you can view the full file.
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Webpack Bundle Analyzer</title>
<!-- viewer.js -->
<script>
@inancsevinc
inancsevinc / gettext.sublime-snippet
Last active December 20, 2015 05:19
Sublime snippets
<snippet>
<content><![CDATA[
<?= _("${1:text}") ?>$0
]]></content>
<tabTrigger>_</tabTrigger>
<scope>text.html.basic</scope>
</snippet>
@inancsevinc
inancsevinc / link_header_parser.js
Created January 28, 2013 13:12
Link Header javascript parser function
@inancsevinc
inancsevinc / jquery.ba-tinypubsub.js
Created October 3, 2012 12:37 — forked from cowboy/HEY-YOU.md
jQuery Tiny Pub/Sub: A really, really, REALLY tiny pub/sub implementation for jQuery.
/* jQuery Tiny Pub/Sub - v0.7 - 10/27/2011
* http://benalman.com/
* Copyright (c) 2011 "Cowboy" Ben Alman; Licensed MIT, GPL */
(function($) {
var o = $({});
$.subscribe = function() {
o.on.apply(o, arguments);
@inancsevinc
inancsevinc / ns_to_package_mapper.py
Created October 1, 2012 06:23
namespace-to-package mapper for non-standard namespaces in wsdl/xsd files, to be run before jax-rpc client generation
import os, re
searchDir= "C:/temp"
mydict = {} #empty dictionary, keys are namespace urls, values are mapped packages
for dirpath, dirnames, filenames in os.walk(searchDir): #walk thru directories recursively
for file in [ f for f in filenames if os.path.splitext(f)[1] in [".xsd",".wsdl"] ]:
with open(os.path.join(dirpath,file)) as current_file:
for line in current_file.readlines():
m = re.search(r'(http://)(isbank\.com([^\"])+)', line)
@inancsevinc
inancsevinc / TestResource.java
Created August 31, 2012 06:09
Expose war package build date as a rest service, using maven, spring and jax-rs
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
/**
* @author Inanc Sevinc
@inancsevinc
inancsevinc / RSAHelper.java
Created August 6, 2012 11:29
Helper class for RSA encryption and key generation(private_key.xml for .net integration)
import java.net.URLEncoder;
import java.security.Key;
import java.security.KeyFactory;
import java.security.KeyPair;
import java.security.KeyPairGenerator;
import java.security.PublicKey;
import java.security.interfaces.RSAPrivateCrtKey;
import java.security.spec.PKCS8EncodedKeySpec;
import java.security.spec.RSAPublicKeySpec;
import java.util.HashMap;
@inancsevinc
inancsevinc / ExtendedJDBCAppender.java
Created August 6, 2012 11:24
Extension of the log4j to allow using a JNDI data source
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import javax.sql.DataSource;
@inancsevinc
inancsevinc / PropertySourceInitializer.java
Created August 2, 2012 06:55
Spring ApplicationContextInitializer class which adds a new PropertySource to Spring's DefaultEnvironment.
import java.util.HashMap;
import java.util.Map;
import org.apache.commons.lang3.exception.ExceptionUtils;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.mapping.Environment;
import org.apache.ibatis.session.Configuration;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.apache.ibatis.session.SqlSessionFactoryBuilder;
@inancsevinc
inancsevinc / TestRSA.java
Created July 10, 2012 09:30
Junit for RSA encryption/decryption
import static org.junit.Assert.*;
import java.math.BigInteger;
import java.security.Key;
import java.security.KeyFactory;
import java.security.KeyPair;
import java.security.KeyPairGenerator;
import java.security.PrivateKey;
import java.security.PublicKey;
import java.security.spec.RSAPrivateKeySpec;