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 * as helpers from '../src/helpers'; | |
describe('formatDate', () => { | |
it('should invoke localString implementation to format date ', () => { | |
const localStringMock = jest.fn(); | |
const mockDate = { toLocaleString: localStringMock }; | |
helpers.formatDate(mockDate); | |
expect(localStringMock).toHaveBeenCalledWith('de-DE', { | |
year: 'numeric', | |
month: '2-digit', | |
day: '2-digit', |
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
public class DynamicSessionIdentifierStrategy implements HttpSessionStrategy { | |
private static CookieHttpSessionStrategy cookieHttpSessionStrategy = | |
new CookieHttpSessionStrategy(); | |
/* Code redacted */ | |
@Override | |
public void onNewSession(Session session, HttpServletRequest httpServletRequest, | |
HttpServletResponse httpServletResponse) { | |
if (!principalManager.isLoggedIn()) { |
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.authentication.CredentialsExpiredException; | |
import javax.servlet.*; | |
import javax.servlet.http.HttpServletRequest; | |
import javax.servlet.http.HttpSession; | |
import java.io.IOException; | |
public class SessionExpiryFilter implements Filter { | |
private final int maxSessionLifeInMinutes; |
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
require 'uri' | |
require 'net/https' | |
require 'json' | |
GITLAB_URL = 'https://gitlab-your-url.com' | |
USERS_API = '/api/v3/users' | |
PRIVATE_TOKEN='XXXXXXXXX' #Private token from Git-lab profile. | |
DEFAULT_PASSWORD = 'some_default_password' |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<Projects> | |
<Project name="main :: build" activity="Sleeping" lastBuildStatus="Success" lastBuildLabel="0.1008 :: 2" lastBuildTime="2011-08-29T15:22:58" webUrl="http://172.18.20.31:8153/go/pipelines/main/1008/build/2"/> | |
<Project name="main :: build :: build" activity="Sleeping" lastBuildStatus="Success" lastBuildLabel="0.1008 :: 2" lastBuildTime="2011-08-29T15:22:58" webUrl="http://172.18.20.31:8153/go/tab/build/detail/main/1008/build/2/build"/> | |
<Project name="main :: build :: metrics" activity="Sleeping" lastBuildStatus="Success" lastBuildLabel="0.1008 :: 2" lastBuildTime="2011-08-29T15:20:46" webUrl="http://172.18.20.31:8153/go/tab/build/detail/main/1008/build/2/metrics"/> | |
<Project name="main :: deploy-to-dev" activity="Sleeping" lastBuildStatus="Success" lastBuildLabel="0.1008 :: 2" lastBuildTime="2011-08-29T15:25:25" webUrl="http://172.18.20.31:8153/go/pipelines/main/1008/deploy-to-dev/2"/> | |
<Project name="main :: deploy-to-dev :: deploy-to-dev" activity="Sle |
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
require 'fileutils' | |
desc "Create nondigest versions of all ckeditor digest assets" | |
task "assets:precompile" => :environment do | |
fingerprint = /\-([0-9a-f]{32})\./ | |
for file in Dir["public/assets/ckeditor/**/*"] | |
# Skip file unless it has a fingerprint | |
next unless file =~ fingerprint | |
# Get filename of this file without the digest |
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
$(document).ready(function () { | |
if (typeof(console) !== 'undefined' && console.log) { | |
var now = new Date().getTime(); | |
var page_load_time = now - performance.timing.navigationStart; | |
console.log("Page loading time: " + page_load_time + ' ms'); | |
} | |
}); |
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 system = require('system'),isDebugMode = false; | |
/** | |
* Wait until the test condition is true or a timeout occurs. Useful for waiting | |
* on a server response or for a ui change (fadeIn, etc.) to occur. | |
* | |
* @param testFx javascript condition that evaluates to a boolean, | |
* it can be passed in as a string (e.g.: "1 == 1" or "$('#bar').is(':visible')" or | |
* as a callback function. | |
* @param onReady what to do when testFx condition is fulfilled, |
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
/* | |
* Copyright (C) 2008 The Android Open Source Project | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
NewerOlder