This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python2 | |
# Usage: $0 proxy.pac url | |
import pacparser | |
import sys | |
import urlparse | |
pacfile, url = sys.argv[1:] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Locale; | |
import org.junit.rules.TestWatcher; | |
import org.junit.runner.Description; | |
public class DefaultLocaleRule extends TestWatcher { | |
private Locale originalDefault; | |
private Locale currentDefault; | |
public DefaultLocaleRule() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.lang.annotation.Annotation; | |
import java.util.List; | |
import java.util.Map; | |
import org.springframework.beans.factory.config.BeanDefinition; | |
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory; | |
import org.springframework.context.ApplicationContext; | |
import org.springframework.context.ConfigurableApplicationContext; | |
import org.springframework.core.type.StandardMethodMetadata; | |
import com.google.common.base.Preconditions; | |
import com.google.common.base.Predicate; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* MIT LICENSE | |
* Copyright (c) 2009-2011 Devon Govett. | |
* | |
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated | |
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation | |
* the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, | |
* and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | |
* | |
* The above copyright notice and this permission notice shall be included in all copies or substantial portions |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
from xml.etree.ElementTree import ElementTree, tostring | |
import os | |
import sys | |
import re | |
template = '''\ | |
<project xmlns="http://maven.apache.org/DECORATION/1.0.0" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.lang.annotation.Annotation; | |
import java.lang.reflect.Field; | |
import java.lang.reflect.Method; | |
import java.lang.reflect.Modifier; | |
import java.util.List; | |
import java.util.Map; | |
import org.junit.After; | |
import org.junit.Rule; | |
import org.junit.runner.RunWith; | |
import org.springframework.aop.TargetClassAware; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import ConfigParser | |
import inspect | |
class DBConfig: | |
__doc__ = 'Collect a couple of config options in a type' | |
def __init__(self): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [[ ! -e pom.xml ]]; then | |
echo "Missing pom.xml" 1>&2 | |
exit 1 | |
fi | |
sed \ | |
-e '/<distributionManagement>/,/<\/distributionManagement>/d' \ | |
-e '/<\/project/d' \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Copyright (c) 2012, Aaron Digulla | |
All rights reserved. | |
Redistribution and use in source and binary forms, with or without | |
modification, are permitted provided that the following conditions are met: | |
* Redistributions of source code must retain the above copyright | |
notice, this list of conditions and the following disclaimer. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.eclipse.emf.ecore.EReference; | |
import org.eclipse.emf.ecore.resource.Resource; | |
import org.eclipse.xtext.EcoreUtil2; | |
import org.eclipse.xtext.common.types.TypesPackage; | |
import org.eclipse.xtext.common.types.xtext.AbstractTypeScopeProvider; | |
import org.eclipse.xtext.common.types.xtext.ClasspathBasedTypeScopeProvider; | |
import org.eclipse.xtext.common.types.xtext.TypesAwareDefaultGlobalScopeProvider; | |
import org.eclipse.xtext.resource.IEObjectDescription; | |
import org.eclipse.xtext.scoping.IScope; |