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
func init() { | |
revel.OnAppStart(InitDB) | |
} |
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 lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"> | |
<title>Fake auto play html audio in iOS Safari the right way</title> | |
</head> | |
<body> | |
<h1>在 iOS Safari 中假装自动播放 HTML5 audio(音乐) 的正确方式</h1> | |
<p>核心原理: 通过一个用户交互事件来主动 play 一下 audio</p> |
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
My Template : | |
<f7-list form> | |
<f7-list-item> | |
<f7-label>Fruit</f7-label> | |
<f7-input type="text" placeholder="Fruit" :id="'autocomplete-dropdown-expand'+_uid"></f7-input> | |
</f7-list-item> | |
</f7-list> | |
methods: | |
initAutoComplete: function() { |
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
Vue.use(Vuex) | |
export default new Vuex.Store({ | |
actions, | |
getters, | |
modules: { | |
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: download with resume/speed/stream options */ | |
/* List of File Types */ | |
function fileTypes($extension){ | |
$fileTypes['swf'] = 'application/x-shockwave-flash'; | |
$fileTypes['pdf'] = 'application/pdf'; | |
$fileTypes['exe'] = 'application/octet-stream'; | |
$fileTypes['zip'] = 'application/zip'; | |
$fileTypes['doc'] = 'application/msword'; |
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
var isLoadingJob = false; | |
var startTime = {}; | |
var endTime = {}; | |
function pingByImage(host, img_path, pong) { | |
if (!isLoadingJob) { | |
isLoadingJob = true; | |
var img = host+img_path; | |
var hashId = hashCode(host); | |
var t = InitiateSpeedDetection(host, img); | |
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 ping(host, port, pong) { | |
var started = new Date().getTime(); | |
var http = new XMLHttpRequest(); | |
http.open("GET", "http://" + host + ":" + port, /*async*/true); | |
http.onreadystatechange = function() { | |
if (http.readyState == 4) { | |
var ended = new Date().getTime(); |
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
//JUST AN EXAMPLE, PLEASE USE YOUR OWN PICTURE! | |
var imageAddr = "http://www.kenrockwell.com/contax/images/g2/examples/31120037-5mb.jpg"; | |
var downloadSize = 4995374; //bytes | |
function ShowProgressMessage(msg) { | |
if (console) { | |
if (typeof msg == "string") { | |
console.log(msg); | |
} else { | |
for (var i = 0; i < msg.length; i++) { |
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 getComponent(vm, tagName){ | |
for (var i = 0; i < vm.$children.length; i++) { | |
if (vm.$children[i].$options.name == tagName) { | |
return vm.$children[i]; | |
} | |
} | |
} |
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
"name": /^[\u4e00-\u9fa5_a-zA-Z]+$/ //中英文only |