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
package leoliang.springtest; | |
import java.util.HashMap; | |
import java.util.Map; | |
import org.springframework.beans.BeansException; | |
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory; | |
import org.springframework.context.ApplicationContext; | |
import org.springframework.context.ApplicationContextAware; | |
import org.springframework.context.support.AbstractRefreshableApplicationContext; |
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.io.BufferedReader; | |
import java.io.File; | |
import java.io.FileInputStream; | |
import java.io.FileNotFoundException; | |
import java.io.IOException; | |
import java.io.InputStream; | |
import java.io.InputStreamReader; | |
import java.io.OutputStream; | |
import java.net.ServerSocket; | |
import java.net.Socket; |
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"?> | |
<beans xmlns="http://www.springframework.org/schema/beans" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xmlns:context="http://www.springframework.org/schema/context" | |
xsi:schemaLocation=" | |
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd | |
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd" | |
default-autowire="byType"> | |
<context:property-placeholder location="file:bin/leoliang/spring/test1/bean.properties"/> |
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
<project | |
xmlns="http://maven.apache.org/POM/4.0.0" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | |
<modelVersion>4.0.0</modelVersion> | |
<groupId>com.mycompany</groupId> | |
<artifactId>localrepodeployer</artifactId> | |
<packaging>jar</packaging> | |
<version>1.0.0</version> |
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
#!/bin/env ruby | |
# --- Configuration --------------------------------- | |
# Remove artifacts which were created before $age_days ago and haven't been downloaded in recent $age_days. | |
$age_days = 730 | |
# The repository to be cleaned. | |
$repo = 'repository-key' |
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
#!/bin/env ruby | |
# --- Configuration --------------------------------- | |
$age_days = 3 | |
# The repository to be cleaned. | |
$repo = 'repo-name' | |
$user = 'repo-admin' |
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
package leoliang.common; | |
import com.google.common.base.Preconditions; | |
/** | |
* Usage example: Run 15 times in every 250ms, begins at 5 seconds later. | |
* | |
* <pre> | |
Scheduler.every(250, Scheduler.TimeUnit.MILLISECOND) | |
.beginsAt(System.currentTimeMillis() + 5000) |
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 interface ActiveCountMetric { | |
void inc(); | |
void dec(); | |
} |
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 _ = require('lodash'); | |
var os = require('os'); | |
function getIpAddr(nicName) { | |
let ifaces = os.networkInterfaces(); | |
let iface = _.find(ifaces[nicName], iface => { return iface.family === 'IPv4' }); | |
return _.result(iface, 'address'); | |
} | |
module.exports = _.memoize(getIpAddr); |
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
#!/usr/bin/env node | |
"use strict"; | |
const fs = require('fs'); | |
const readline = require('readline'); | |
const logLineRegexp = /\s+(.+?)\[(.+?)\](.*)/; | |
function processFile(file, host) { |
OlderNewer