Skip to content

Instantly share code, notes, and snippets.

var u = new SpeechSynthesisUtterance("持續檢討 積極改進 上緊發條 全力以赴");
u.lang = "zh-TW" // So system knows the right voice to use
window.speechSynthesis.speak(u);
interface SpeechSynthesisUtterance : EventTarget {
attribute DOMString text; //要說的文字
attribute DOMString lang; //文字的語言
attribute DOMString voiceURI; //語音引擎來源
attribute SpeechSynthesisVoice voice; //Only in WebKit implementation.
attribute float volume; //講話的音量(0~1)
attribute float rate; //講話的速率
attribute float pitch; //講話的節拍(0~2)
attribute EventHandler onstart;
var u = new SpeechSynthesisUtterance("我說國語,我也說廣東話"),
voices = speechSynthesis.getVoices();
u.voice = voices[44]; // zh-HK Sin-Ji Compact in my environment.
speechSynthesis.speak(u);
<section id="announcements">
<h1>Announcements</h1>
<article class="post"> ... </aticle>
<article class="post"> ... </aticle>
...
<article class="post"> ... </aticle>
</section>
<nav class="pagination">
<a class="next" href="/page/2">Next</a>
$('#announcements').infinitescroll(options,
function(itemsAppendedArray, options, pagePath) {
//do something here
}
}
$('#announcements').infinitescroll({
loading: {
start: function(options) {
// Do something here.
$(this).data('infinitescroll').beginAjax(options)
},
finished: function() {
// Do something here.
}
},
$('#announcements').infinitescroll({
errorCallback: function(errorType) {
if (errorType == "done") { // Do something here }
},
// Other options omitted.
});
cd ~/Application\ Support/godus
ln -s ~/Dropbox/sync/godus/prf11000xxxxxxxxxx ~/prf11000xxxxxxxxxx
@zhusee2
zhusee2 / effector-for-logdown.html
Created October 6, 2013 09:32
A port of Effector Theme for Tumblr to Logdown. Based on works of http://tumblr.com/themes/by/pixelunion
<!DOCTYPE html>
<!--[if lt IE 7 ]> <html lang="en" class="no-js ie6 lte-ie8"> <![endif]-->
<!--[if IE 7 ]> <html lang="en" class="no-js ie7 lte-ie8"> <![endif]-->
<!--[if IE 8 ]> <html lang="en" class="no-js ie8 lte-ie8"> <![endif]-->
<!--[if (gte IE 9)|!(IE)]><!--> <html lang="en" class="no-js"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
<meta name="viewport" content="width=device-width, initial-scale=1" />
#=require underscore.js
class BaseClass
@concerning: (concernName, concernObj) ->
functionsToCopy = _.omit(mixin, "included", "classFunctions")
_.extend(this.prototype, functionsToCopy)
_.extend(this, concernObj.classFunctions)
if typeof concernObj.included is "function"
concernObj.included.call(concernObj, this)