This file contains hidden or 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
* { | |
margin: 0; | |
padding: 0; | |
border: 0; | |
} | |
body { | |
background: #ddf; | |
font: 30px sans-serif; | |
} |
This file contains hidden or 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 | |
// put your code here | |
/* | |
header("HTTP/1.0 200"); | |
header("Content-Type: video/quicktime;"); | |
header('Content-Transfer-Encoding: binary'); | |
header('Expires: 0'); | |
header('Cache-Control: must-revalidate'); | |
header('Pragma: public'); | |
header('Content-Length: ' . filesize($file)); |
This file contains hidden or 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 quoteStatus(id, user, ele) { | |
id = id || popup_id; | |
user = user || popup_user; | |
ele = ele || popup_ele; | |
if (!id) return false; | |
if ($('lock-' + ele.id) && !confirm(_("This tweet is protected; Are you sure to retweet?"))) return false; | |
var tw = !display_as_rt && ele.tw.retweeted_status || ele.tw; | |
$('fst').value = twitterURL.replace('http', 'https') + "#!/" + user + "/statuses/"+ id + " RT @"+user+": " + charRef(tw.text); | |
$('fst').focus(); $('fst').select(); | |
return false; |
This file contains hidden or 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
[extensions] | |
hgext.zipdoc = | |
[encode] | |
# Office Open XML | |
**.docx = zipdocencode | |
**.docm = zipdocencode | |
**.dotx = zipdocencode | |
**.dotm = zipdocencode | |
**.xlsx = zipdocencode |
This file contains hidden or 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
// p.101 | |
// String | |
var name= 'Curly'; | |
var initial = name.charAt(0); | |
var s = 'C'.concat('a', 't'); | |
var text = 'Mississippi'; | |
var p = text.indexOf('ss'); | |
p = text.indexOf('ss', 3); |
This file contains hidden or 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.prototype.method = function (name, func) { | |
if (!this.prototype[name]) { | |
this.prototype[name] = func; | |
return this; | |
} | |
}; | |
String.method('entityify', function () { | |
var character = { | |
'<' : '<', |
This file contains hidden or 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 press(e) { | |
if (e != 1) key_press_detected = true; | |
if (e != 1 && (e.keyCode != 13 && e.keyCode != 10 || | |
!decr_enter && (e.ctrlKey || e.shiftKey) || decr_enter && !(e.ctrlKey || e.shiftKey)) ) | |
return true; | |
var st = document.frm.status; | |
if (!key_press_detected) st.value = st.value.replace(/\n/g, ""); | |
if (st.value == '') { | |
update(); | |
return false; |
This file contains hidden or 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
registerPlugin({ | |
newMessageElement: function(elem, tw) { | |
tw = tw.retweeted_status || tw; | |
if (tw.entities && tw.entities.media) { | |
for (var i = 0; i < tw.entities.media.length; i++) { | |
if (tw.entities.media[i].type == "photo") { | |
addThumbnail(elem, | |
tw.entities.media[i].media_url + ":thumb", | |
tw.entities.media[i].media_url + ":large"); | |
} |
This file contains hidden or 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 twAuthFallback() { | |
// verify_credentials API is unavailable? | |
re_auth = true; | |
xds.load_default(twitterAPI + "users/show.json?suppress_response_codes=true&screen_name="+myname, twAuth); | |
} | |
function auth() { | |
if (use_ssl) | |
twitterAPI = twitterAPI.replace('http', 'https'); | |
var name = readCookie('access_user'); | |
if (name) { |
This file contains hidden or 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 n = [4, 8, 15, 23, 42]; | |
n.sort(); | |
n.sort(function(a, b) { | |
return a-b; | |
}); | |
var m = ['aa', 'bb', 'a', 4, 8, 15, 16, 23, 42]; | |
m.sort(function(a, b) { | |
if (a === b) { | |
return 0; | |
} |