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
yell() { | |
cmd="" | |
if [ $# -gt 0 ]; then | |
cmd=$@ | |
else | |
cmd=$(history| awk '{$1=""; print $0}' | grep -E '^\s*yell.+' | tail -1) | |
fi | |
eval $cmd |
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
function findc { | |
local pid=$1 | |
local containerLabel=$(head -1 /proc/11212/cgroup | sed -E 's|.*pod([0-9a-z\-]*).*|\1|') | |
if [[ "${containerLabel}" == "" ]]; then | |
echo "no container found with regards to PID $pid" | |
exit 2 | |
fi | |
local matchedID=$(docker ps -a | grep "${containerLabel}" | awk '{ print $1 }' 2>/dev/null) | |
while read -r id; do |
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
function randomSeq(begin, end, number) { | |
var i = 0; | |
var range = end - begin; | |
var exchanged = {}; | |
var seq = []; | |
while (i < number) { | |
const v = i + Math.floor(Math.random() * (range - i)); | |
if (exchanged[v] !== undefined) { | |
seq.push(begin + exchanged[v]); | |
} else { |
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
class PrivateFuncHelper { | |
constructor() { | |
var self = this; | |
Object.defineProperties(this, { | |
'_': { | |
value: function(func) { | |
return func.apply(self, Array.prototype.slice.call(arguments, 1)); | |
} | |
}, | |
'_bind': { |
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
'use strict'; | |
exports = module.exports = CacheKey; | |
function CacheKey(symbol) { | |
if (!symbol || typeof symbol !== 'string') throw new Error('The symbol of cache key must be string'); | |
this.type = symbol; | |
this.keys = {}; | |
this.single = {}; | |
} |
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) 2006, 2008 Valery Kholodkov | |
* Client body reception code Copyright (c) 2002-2007 Igor Sysoev | |
* Temporary file name generation code Copyright (c) 2002-2007 Igor Sysoev | |
*/ | |
#include <ngx_config.h> | |
#include <ngx_core.h> | |
#include <ngx_http.h> | |
#include <nginx.h> |