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 | |
define('OTP_LEN', 6); | |
define('OTP_INT', 30); | |
define('OTP_WIN', 4); | |
function hotp(string $key, int $counter, $len = OTP_LEN) | |
{ | |
static $alphabet = [ | |
'A' => 0, 'B' => 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
<filters> | |
<item enabled="true">t=#</item> | |
<item enabled="true">t=0.5</item> | |
<item enabled="true">t=1.5</item> | |
<item enabled="true">t=2.0</item> | |
<item enabled="true">t=no.1</item> | |
<item enabled="true">t=一口气</item> | |
<item enabled="true">t=你不是一个人</item> | |
<item enabled="true">t=保佑</item> | |
<item enabled="true">t=再来亿遍</item> |
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 | |
function gzdecode($content) { | |
return gzinflate(substr($content, 10, -8)); | |
} | |
?> |
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
<?=intval(1000*(microtime(TRUE)-$_SERVER['REQUEST_TIME_FLOAT']))?> |
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
[Unit] | |
Description=opentracker server | |
After=network.target | |
[Service] | |
ExecStart=/usr/sbin/opentracker | |
Restart=on-failure | |
[Install] | |
WantedBy=multi-user.target |
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() { | |
var title = document.title; | |
document.addEventListener('visibilitychange', function() { | |
if (document.hidden) { | |
document.title = 'Hey!'; | |
} else { | |
document.title = title; | |
} | |
}); | |
})(); |
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
daemon() { | |
while true; do | |
$@ | |
sleep 1 | |
done | |
} |
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
package info.jamesliu.servlet; | |
import java.awt.Color; | |
import java.awt.Font; | |
import java.awt.Graphics2D; | |
import java.awt.image.BufferedImage; | |
import java.io.IOException; | |
import java.util.Base64; | |
import java.util.Random; |
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 makeToast(text) { | |
var $this = $('<div>').addClass('toaster').text(text).css({ | |
'position': 'fixed', | |
'top': '50%', | |
'left': '50%', | |
'padding': '15px 20px', | |
'background-color': 'rgba(0,0,0,.5)', | |
'color': '#eee', | |
'border-radius': '5px', | |
'display': 'none' |
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 getQuery(name) { | |
var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)', 'i'); | |
var r = window.location.search.substr(1).match(reg); | |
if (r != null) return decodeURIComponent(r[2]); | |
return ''; | |
} |