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
Trace of ID 1 | |
1497340609369: Received request. ID: 1 | |
1497340609369: Step 1 1 | |
1497340610599: Step 2 1 | |
1497340610602: Response sent 1 | |
----- | |
Trace of ID 2 | |
1497340606575: Received request. ID: 2 | |
1497340606575: Step 1 2 | |
1497340612700: Step 2 2 |
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
// ==UserScript== | |
// @name Webpages slideshow | |
// @namespace https://github.com/aleung/ | |
// @version 1.1.0 | |
// @description Loop display a serial of webpages. Display time for each page can be set. | |
// @author Leo Liang | |
// @license MIT License | |
// @include * | |
// @noframes | |
// @require https://openuserjs.org/src/libs/sizzle/GM_config.js |
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
// ==UserScript== | |
// @name Tuleap Tracker Enhance | |
// @namespace https://gist.github.com/aleung/3fac39dbba3351da2c62f8d4890ef3a6 | |
// @version 0.4 | |
// @description Toggle detail in card wall | |
// @author Leo Liang | |
// @match https://*/plugins/tracker/* | |
// ==/UserScript== | |
(function() { |
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
/************************************** | |
* Header Counters in TOC | |
**************************************/ | |
/* No link underlines in TOC */ | |
.md-toc-inner { | |
text-decoration: none; | |
} | |
.md-toc-content { |
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
# size of immediate sub-folders | |
du -d1 -BM | sort -g |
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) { |
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
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
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
#!/bin/env ruby | |
# --- Configuration --------------------------------- | |
$age_days = 3 | |
# The repository to be cleaned. | |
$repo = 'repo-name' | |
$user = 'repo-admin' |