Skip to content

Instantly share code, notes, and snippets.

var msg1 = "您知道您使用的 Internet Explorer 瀏覽器已經該退休了嗎?";
var msg2 = "太舊的瀏覽器比較不安全,而且還可能會使瀏覽網路時遇到許多障礙。建議您升級到較新的版本,或是改用其他的瀏覽器,以獲得更好的使用體驗。下面有一些熱門又先進的瀏覽器推薦給您。";
var msg3 = "只要點選圖示,就可以連到各瀏覽器的下載頁面。";
var br1 = "Internet Explorer 8+";
var br2 = "Firefox 3.5+";
var br3 = "Safari 5+";
var br4 = "Opera 11+";
var br5 = "Chrome 5+";
var url1 = "http://www.microsoft.com/ie";
var url2 = "http://www.firefox.com/";
(function() {
var loc = location.href.replace(/\/#!.*/,$('a.tweet-timestamp').attr('href').match(/\/#!(.*)/)[1]);
var text = $('div.tweet-text').text();
var id = $('a.tweet-timestamp').attr('href').match(/#!\/(\w+)/)[1]
var final = loc + ' (轉推' + id + '):「' + text + '」';
window.prompt('人工RT轉噗浪', final);
})();
@zhusee2
zhusee2 / skyfool.md
Created November 23, 2012 03:50
Skyfool

Skyfool poster

Skyfool

(Skyfall by Adele parody)

This is the end
Hold your breath for two minutes
Feel the earth move and then
Hear his “praise” burst again
@zhusee2
zhusee2 / HOTSSubtitleConverter.coffee
Last active December 15, 2015 21:28
Convert subtitles of StarCraft II: Heart of the Swarm cinematic videos (.event) to SubRip format (.srt)
class CinematicSubtitleConverter
constructor: (@file_path) ->
@subtitleFileNames = []
@_initSubtitleList()
convert: (index) ->
subtitlePath = "#{@file_path}/#{@subtitleFileNames[index]}"
subtitleFile = new CinematicSubtitle(subtitlePath)
console.log subtitleFile
@zhusee2
zhusee2 / jquery-deferred-example.js
Created April 26, 2013 15:13
An example for how you might possibly use jQuery Deferred Object.
function doHeavyWork() {
var deferred = $.Deferred(),
meaningOfLife = new Array();
setTimeout(function() {
for (var i = 0; i < 65536; i++) {
meaningOfLife[i] = new Array();
for (var j = 0; j < 65536; j++) {
meaningOfLife[i][j] = new Array();
for (var k = 0; k < 65536; k++) {
jQuery(function($) {
var continueFlag = false;
var logScroll = function() {
console.log(window.scrollY, continueFlag);
if (continueFlag) {
setTimeout(function() { logScroll() }, 1000/60);
}
}
China.claim do |one_china|
one_china = {
:name => "People's Republic of China",
:territory => ["Mainland China", "Taiwan"]
}
Taiwan.claim do |one_china|
one_china = {
:name => "Republic of China",
:territory => ["Mainland China", "Taiwan"]
<%= f.text_field :title %>
<%= f.text_field :body %>
@zhusee2
zhusee2 / css-tricks-news-widget.js
Last active December 19, 2015 10:49
Example script files from the concept of "Structure JavaScript with Module Pattern" on CSS-Tricks. (http://css-tricks.com/how-do-you-structure-javascript-the-module-pattern-edition/)
var NewsWidget = {
init: function() {
// Do some init stuffs
}
otherMethods: function() {
// Expend the ability of the widget
}
};
class MyNameSpace.EditorBase
constructor: (@container) ->
@toolbar = new MyNameSpace.EditorToolbar()
# Other init stuff