Skip to content

Instantly share code, notes, and snippets.

View TheSin-'s full-sized avatar

Justin F. Hallett TheSin-

View GitHub Profile
@TheSin-
TheSin- / runme.sh
Last active March 2, 2018 03:04
Terracoin + Supervisor + logrotate + Sentinel + Cron + terracoind-status - setup on VPS
#!/bin/bash
#This will help anyone setup a Terracoin Masternode on a debian (Ubuntu) VPS
# change this values
version='0.12.1.8' # current terracoin release
coreversion='0.12.1' # current terracoin release minus last digit
##### don't change bellow this line ######
sudo echo
@TheSin-
TheSin- / terracoin_budget_payout_dates.sh
Created January 17, 2018 03:51
estimate future terracoin budget payout dates
#!/bin/bash
D0=$(TZ=UTC date --date="$(date --date="2017-10-23T20:07:35+0000")");
for block in `seq 1123200 21600 $((1101600 + (21600*48)))`;
do DD=$(TZ=UTC date --date="$(date --date="$D0") +763 hours +12 minutes");
D0=$DD;
echo "$block - $DD";
done
@TheSin-
TheSin- / output_callback.param.js
Last active September 28, 2017 01:38
How to get all results via output callback with TableSorter and Ajax pager
output_callback : function(c, data, url) {
var filename = $('#A3opts .output-filename').val();
var newURL = url.replace(/page=[0-9]+/, 'page=0').replace(/size=[0-9]+/, 'size=10000000');
if (c.originalSettings.widgetOptions.output_saveFileName == 'dynamic')
filename = $('" . $this->table . "').find('caption').text().replace(/\s/g, '_') + '.csv';
$('#csvForm #filename', top.$('#toolbar').contents()).val(filename);
// remove filters for all rows
if (c.widgetOptions.output_saveRows == 'a')
newURL = newURL.replace(/&fcol(\[[0-9]+\])?=.+/g, '') + '&fcol';
@TheSin-
TheSin- / csv.php
Last active August 29, 2015 14:01
TableSorter output widget using ajax for saveAs...
<?php
// Make sure we dont' time out, this is optional
@set_time_limit(10000);
$filename = "output.csv";
if (!empty($_POST['filename']) )
$filename = $_POST['filename'] ;
// NO CACHE
header("Pragma: public");