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
<meta name="viewport" id="viewport" /> | |
<script> | |
var viewport_width = 400; | |
(function(target_width){ | |
var device_width = screen.width || 320, | |
ratio = (device_width/target_width); | |
// desktop or some old mobile browser | |
if(device_width > 414 || device_width < 320) | |
ratio = 1.0; | |
document.getElementById('viewport').content = "width=device-width,user-scalable=1,initial-scale=" + ratio; |
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(w, ua){ | |
if(ua.indexOf('Android') > -1 && ua.indexOf('Chrome') ==-1) | |
return; | |
$("body").css('min-height', Math.ceil( | |
$(document).width() * ($(w).height()/$(w).width()) | |
)); | |
})(window, navigator.userAgent); |
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
tinypng() { | |
for f in *.png | |
do | |
cmd="curl -s --user api:YOUR_API_KEY --data-binary @$f https://api.tinypng.com/shrink | sed 's/.*https/https/g' | sed 's/\.png.*/.png/g' | xargs curl -s -o $f" | |
eval "$cmd"; | |
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
#!/bin/bash | |
# | |
# The MIT License (MIT) | |
# | |
# Copyright (c) 2014 Mathias Leppich <mleppich@muhqu.de> | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a copy | |
# of this software and associated documentation files (the "Software"), to deal | |
# in the Software without restriction, including without limitation the rights | |
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
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
root /home/wwwroot; | |
+ error_page 500 502 503 504 /static/500.html; |
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
<!DOCTYPE html> | |
<html> | |
<meta charset="utf-8" /> | |
<style type="text/css"> | |
#main { font-family: arial; font-size:18px; } | |
#time { position:fixed; bottom:5px; right:5px; color:lightgray;} | |
</style> | |
<body> | |
<span id="time"></span> | |
<span id="main">Loading<span id="dot">.</span></span> |
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 | |
if(is_file('/home/wwwroot/dbchecker')) | |
require LIB_PATH . '/database/checker.php'; |
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 | |
$mysql_checker = function(){ | |
$cfg = explode("\t", DB_CFG); | |
error_reporting(E_ERROR); | |
$try_num = 20; | |
$try_interval = 500000; // 0.5 sec | |
foreach(range(0, $try_num) as $times) | |
{ |
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
import sys | |
import types | |
import os | |
import urllib | |
import cgi | |
import logging | |
from Cookie import SimpleCookie | |
# instance | |
_liter = 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
from pili import lite | |
def main(): | |
lite.init(globals()) | |
echo('hello world') | |
if __name__ == '__main__': | |
main() |
OlderNewer