This file contains 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.springframework.util.AntPathMatcher; | |
import org.springframework.web.filter.GenericFilterBean; | |
import javax.servlet.FilterChain; | |
import javax.servlet.ServletException; | |
import javax.servlet.ServletRequest; | |
import javax.servlet.ServletResponse; | |
import javax.servlet.http.HttpServletRequest; | |
import javax.servlet.http.HttpServletResponse; | |
import java.io.IOException; |
This file contains 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.apache.http.HeaderElement; | |
import org.apache.http.HeaderElementIterator; | |
import org.apache.http.HttpResponse; | |
import org.apache.http.client.config.RequestConfig; | |
import org.apache.http.config.Registry; | |
import org.apache.http.config.RegistryBuilder; | |
import org.apache.http.conn.ConnectionKeepAliveStrategy; | |
import org.apache.http.conn.socket.ConnectionSocketFactory; | |
import org.apache.http.conn.socket.PlainConnectionSocketFactory; | |
import org.apache.http.conn.ssl.SSLConnectionSocketFactory; |
This file contains 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.BitSet; | |
import org.joda.time.DateTimeUtils; | |
import org.slf4j.Logger; | |
import org.slf4j.LoggerFactory; | |
/** | |
* Creates unique (likely consecutive) integers which can be used | |
* within a 30min (to 1hr) period. Main methods are: | |
* * nextNonce - to return an integer. |
This file contains 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.slf4j.Logger; | |
import org.slf4j.LoggerFactory; | |
import sun.security.tools.keytool.CertAndKeyGen; | |
import sun.security.x509.X500Name; | |
import java.io.IOException; | |
import java.security.InvalidKeyException; | |
import java.security.KeyStore; | |
import java.security.KeyStoreException; | |
import java.security.NoSuchAlgorithmException; |
This file contains 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.springframework.security.core.AuthenticationException; | |
import org.springframework.security.web.AuthenticationEntryPoint; | |
import javax.servlet.ServletException; | |
import javax.servlet.http.HttpServletRequest; | |
import javax.servlet.http.HttpServletResponse; | |
import javax.servlet.http.HttpServletResponseWrapper; | |
import java.io.IOException; | |
public class AjaxAwareAuthEntryPointWrapper implements AuthenticationEntryPoint { |
This file contains 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
/****************************************************************************** | |
* Inquire: a mocking mechanism for RequireJS (v2.1.9 - tightly coupled) * | |
* * | |
* Unversioned * | |
* * | |
* NOTE: Don't use Inquire for anything which modifies global scope! * | |
******************************************************************************/ | |
var inquire; | |
(function(require) { |
This file contains 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
var originalSet = Backbone.Model.prototype.set | |
, noConflictPrefix = '$$'; | |
/** | |
* During initial construction, a model | |
* calls set(), but there is also a check | |
* to ensure the reactivity only occurs on construction | |
*/ | |
Backbone.Model.prototype.set = function() { | |
var duringConstruction = (this.changed === null); |
This file contains 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
// See this in action: https://jsfiddle.net/mikeapr4/t4x0oe9k/ | |
// Queue-orientated solution, will work for large-scale | |
// nesting (50k+), however additional overhead of space (queue) | |
const flatten = A => { | |
const output = [], queue = [...A] | |
while (queue.length > 0) { | |
const entry = queue.shift() | |
if (Array.isArray(entry)) { |
This file contains 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 moment from 'moment'; | |
import 'moment-timezone'; | |
// Make all fields on `object` hidden (not enumerable) | |
// except any in the whitelist. | |
const hideFields = (object, whitelist) => Object.keys(object) | |
.forEach((field) => { | |
if (!whitelist.includes(field)) { | |
const val = object[field]; | |
Object.defineProperty(object, field, { |
This file contains 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
mappedTask2: (state, getters) => { | |
const cache = {}; | |
return (id) => { | |
const record = state.tasks[id]; | |
const key = id + record.name; | |
if (!cache[key]) { | |
cache[key] = getters.mappedTask(id); | |
} | |
return cache[key]; | |
}; |
OlderNewer