Skip to content

Instantly share code, notes, and snippets.

@mandb
mandb / gist:7776326
Created December 3, 2013 19:52
infinitely extendable time variation with adjustable precision
/* simple-text output for time periods measured in seconds */
function timeAgo($seconds, $precision=2){
$i[1]='s';
$i[60]='m';
$i[3600]='h';
$i[86400]='d';
$i[31536000]='y';
/* bullshit businses model generator v2 */
// action verbs - "make"
array1 = new Array("implement", "host", "utilize", "incentivize", "integrate", "build", "design", "exchange", "optimize", "encrypt", "decentralize", "enable", "store", "leverage", "reinvent", "process", "aggregate", "reaffirm", "incentivize", "morph", "translate", "monetize", "harness", "facilitate", "distribute", "redistribute", "disintermediate", "synergize", "strategize", "deploy", "rethink", "synchronize", "target", "syndicate", "synthesize", "deliver", "open-source", "incubate", "engage", "maximize", "transact", "exploit", "whiteboard", "visualize", "repurpose", "innovate", "scale", "unleash", "drive", "institutionalize", "engineer", "revolutionize", "generate", "exploit", "transition", "sign", "pivot", "iterate upon", "cultivate", "productize", "redefine", "recontextualize");
// adjective "extreme"
array2 = new Array("trust-free", "distributed", "encrypted", "meta", "proof-based", "gender-neutral", "fair-trade", "collaborative", "an
@mandb
mandb / gist:a885607137a844635289
Last active August 29, 2015 14:02
mintpall sell-to click
$('#buyTable, #sellTable').on('click', '.clickableOrder', function(event) {
event.preventDefault();
var myClass=this.className;
var sumPairSource = parseFloat($(this).find('.amount').text());
var sumPairTarget = parseFloat($(this).find('.amount').text()) * parseFloat($(this).find('.price').text());
var orderQty = 0; // coin order tally
var orderPrice = 0; // order price avg per coin
var orderValue = 0; // total exchange value of coin order
@mandb
mandb / gist:d595d9a1ee47335e390e
Created September 26, 2014 17:44
parallel brick copy
$brickdir = '/storage1';
$glusterdir = '/storage';
// if you only want to copy certain directories, specify them here
$directories = array('apt-mirror', 'apt-repo', 'downloads', 'torrents', 'storage');
$max_copies = 100; // concurrency
$file_size = 0; // total copied file size
{
"_id" : ObjectId("552d93b8b1a43d62478c6676"),
"type" : "file",
"date_added" : ISODate("2013-03-14T22:38:06.000Z"),
"file_name" : "180668.bmp",
"hash" : "ff6cf79ef4330b11e18fdd776a38696df9c1667c",
"mime" : "image/bmp",
"name" : "pulstar.bmp",
"parentId" : ObjectId("552d93b8b1a43d62478c6601"),
"path" : ",552d93b8b1a43d62478c65fd,552d93b8b1a43d62478c6601",