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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Body Skeleton</title> | |
<script> | |
/** | |
* The drawSkeleton() function takes an array of keypoints as an argument | |
* and draws the skeleton on the canvas. | |
*/ |
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
if (sb.length() > 4000) { | |
Log.v(TAG, "sb.length = " + sb.length()); | |
int chunkCount = sb.length() / 4000; // integer division | |
for (int i = 0; i <= chunkCount; i++) { | |
int max = 4000 * (i + 1); | |
if (max >= sb.length()) { | |
Log.v(TAG, "chunk " + i + " of " + chunkCount + ":" + sb.substring(4000 * i)); | |
} else { | |
Log.v(TAG, "chunk " + i + " of " + chunkCount + ":" + sb.substring(4000 * i, max)); | |
} |
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
// kills long running ops in MongoDB (taking seconds as an arg to define "long") | |
// attempts to be a bit safer than killing all by excluding replication related operations | |
// and only targeting queries as opposed to commands etc. | |
killLongRunningOps = function(maxSecsRunning) { | |
currOp = db.currentOp(); | |
for (oper in currOp.inprog) { | |
op = currOp.inprog[oper-0]; | |
if (op.secs_running > maxSecsRunning && op.op == "query" && !op.ns.startsWith("local")) { | |
print("Killing opId: " + op.opid |
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 collectionNames = db.getCollectionNames(), stats = []; | |
collectionNames.forEach(function (n) { stats.push(db[n].stats()); }); | |
stats = stats.sort(function(a, b) { return b['size'] - a['size']; }); | |
for (var c in stats) { print(stats[c]['ns'] + ": " + stats[c]['size'] + " (" + stats[c]['storageSize'] + ")"); } |
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
// Number of CPUs | |
nproc | |
// RAM size and Swap Size | |
free -m | |
// Disk Size | |
df -h |
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/bash | |
# https://gist.github.com/mManishTrivedi/ba64d0423e8a4692c0687b9d0b2078a8 | |
LOADING=false | |
DEBUG=/dev/null | |
usage() | |
{ | |
cat << EOF | |
usage: $0 [options] <DBNAME> |
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
/* Node.js */ | |
var crypto = require('crypto'), | |
algorithm = 'aes-256-ctr'; | |
data = "manish" | |
encryption_key = "VHUz1dxrhsowwEYGqUnPcE4wvAyz7Vmb"; | |
encryption_data = _encrypt() | |
console.log('encrypted data :: ' + encryption_data); |
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
// Do experiment here "http://jsfiddle.net/FLhpq/1958/" | |
//Query : timestamp (second) to current date | |
moment.unix(1442555078).calendar(); | |
// output : Today at 11:14 AM | |
//Query : Timestamp (second) to proper format | |
moment.unix(1442555078).format('LLLL'); | |
// output : Friday, September 18 2015 11:14 AM |
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
<?php | |
// Follow these steps to achieve overwrite no result Message in XiUS result page | |
// 1# copy your default_profile.php file like your xius template is default | |
// copy file _SITE_ROOTS_/components/com_xius/templates/default/default_profile.php | |
// 2# Paste this file to following hierarchy | |
// _SITE_ROOTS_/templates/_CURRENT_SITE_TEMPLATE/html/com_xius/default_profile.php | |
// 3# paste following code to near the line 13-14 | |
?> | |
<?php | |
# overwrite code start here |
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
<?php | |
/** | |
* | |
* Return all class attribute name. Included Public, protected, Private and static. | |
* It will filter base class attribute | |
* | |
* @param $className | |
* | |
* @return Attribute array | |
*/ |
NewerOlder