joxi – Chrome Plugin

joxi

Fast application screenshots in your browser! With page scrolling!

Joxi for Google Chrome lets you create, edit and deploy cloud storage screenshots long web pages with scrolling. The plugin is part of a free service Joxi – ultrafast tool for sharing screenshots and files over a network.

★ Instant screenshot web page in its entire length
Long pages that span multiple screens, no longer need a screenshot in parts. Set Joxi and remove the entire page in one step.
★ Very simple operation
After installing the app in the Google Chrome toolbar icon appears Joxi. Clicking on it, you can make a screenshot of the whole page or fragment thereof.
★ Fast shipping screenshot in the “cloud" and social networks
Ready screenshot single click you can send to a cloud server on Joxi.ru, publish in social networks or save to a local drive.
★ Free hosting screenshots
Registered users get 1 GB of free space in the “cloud."
★ Easy to use graphical editor
The screenshots you can draw arrows and frames, typing, obscure piece of information, change the color and line thickness.

Make a screenshot to see how comfortable with Joxi!

Reference : http://joxi.net/

strtotime (PHP)

<?php
$date_now = date('Y-m-d', strtotime('+1 years'));
$date_now = date('Y-m-d', strtotime("-1 day", strtotime($date_now)));
echo $date_now;
?>

將英文文本日期時間解析為Unix 時間戳:

<?php
    echo(strtotime("now")); //現在時間
    echo(strtotime("3 October 2005")); //2015-10-03
    echo(strtotime("+5 hours")); //現在時間+5小時
    echo(strtotime("+1 week")); //現在時間+1星期
    echo(strtotime("+1 week 3 days 7 hours 5 seconds")); //現在時間 +1星期3天7小時5秒
    echo(strtotime("next Monday")); //下個星期的星期一
    echo(strtotime("last Sunday")); //上個星期的星期天
    //輸出
    //1530144600
    //1473004800
    //1530162600
    //1530749400
    //1531033805
    //1530460800
    //1529769600
?>

日期時間相減
strtotime()轉換成為Unix時間戳,可直接使用兩個時間戳相減計算時間差。

<?php
    echo $time1="2015-11-18 23:00:00";
    echo $time2="2015-11-22 05:00:00";

    echo (strtotime($time1) - strtotime($time2)); //計算相差之秒數
    echo (strtotime($time1) - strtotime($time2))/ (60); //計算相差之分鐘數
    echo (strtotime($time1) - strtotime($time2))/ (60*60); //計算相差之小時數
    echo (strtotime($time1) - strtotime($time2))/ (60*60*24); //計算相差之天數
?>

//計算相差之分鐘數

<?php
$to_time = strtotime("2017-09-12 00:00:00");
$from_time = strtotime("2017-09-12 02:00:00");
echo round(abs($to_time - $from_time) / 60,2). " minute";
?>

strtotime()轉換為日期格式date()

<?php
    //目前時間 加 1小時
    echo date('Y-m-d H:i:s', strtotime('+1 hours'));
    //2017-01-19 13:17:07
?>

Post data to api return json result

<?php 
	$url = http://127.0.0.1/api.php;

	$token = "398cfd96a89a5f45fac326b6778f5da4";
	$agent = $_SERVER['HTTP_USER_AGENT'];

	// POST ITEM
	$query = array(
		"access_token" => $token, 
		"memberID" => "00000001",
	);

	$ch = curl_init();
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
	curl_setopt($ch,CURLOPT_USERAGENT, $agent);
	curl_setopt($ch, CURLOPT_URL, $url);
	curl_setopt($ch, CURLOPT_POST, count($query));
	curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($query));
	$result = curl_exec($ch);
	curl_close($ch);
	$result = json_decode($result, true);

	echo "<pre>";
	print_r($result);
	echo "</pre>";
?>

setInterval or setTimeout

setInterval

<!DOCTYPE html>
<html>
	<head>
		<title>Jquery setinterval stop after sometime</title>
		<script type="text/javascript" src="//code.jquery.com/jquery-1.4.2.min.js"></script>
		<script type='text/javascript'>
			$.ajaxSetup({ cache: false })
		</script>
	</head>
	<body>
		<input type="button" value="Start count!" onclick="startTimer()"> 
		<input type="button" value="Stop count!" onclick="stopTimer()"> 
		<br/>
		<div id="countdown_text">Placeholding text</div>
		<script type="text/javascript">
			var timer = null, 
			value = 0;

			function startTimer(){
				if (timer !== null) return;
				timer = setInterval(function () {
					document.getElementById('countdown_text').innerHTML = ++value;
				}, 1000); 
			}

			function stopTimer(){
				clearInterval(timer);
				timer = null
			}		
		</script>
	</body>
</html>

setTimeout

<!DOCTYPE html>
<html>
<body>
	<title>Jquery setinterval stop after sometime</title>
		<script type="text/javascript" src="//code.jquery.com/jquery-1.4.2.min.js"></script>
		<script type='text/javascript'>
			$.ajaxSetup({ cache: false })
		</script>
		<button onclick="startCount()">start</button>
		<button onclick="stopCount()">stop</button>
		<div id="countdown_text">Placeholding text</div>

		<script>
			var c = 0;
			var t;
			var timer_is_on = 0;

			function timedCount() {
				document.getElementById('countdown_text').innerHTML = c;
				c = c + 1;
				t = setTimeout(
						function(){ 
							timedCount() 
						}, 1000
					);
			}

			function startCount() {
				if (!timer_is_on) {
					timer_is_on = 1;
					timedCount();
				}
			}

			function stopCount() {
				clearTimeout(t);
				timer_is_on = 0;
			}
		</script>
</body>
</html>

Remark :
setTimeout (無限loop)
setTimeout (僅行一次)