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
// 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 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 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 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 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 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; | |
} |
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 a = ['a', 'b', 'c']; | |
var b = ['x', 'y', 'z']; | |
var c = a.concdat(b,true); | |
a.push('d'); | |
var c = a.join(''); | |
var a = ['a', 'b', 'c']; | |
var c = a.pop(); |
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.prototype.method = function (name, func) { | |
if (!this.prototype[name]) { | |
this.prototype[name] = func; | |
return this; | |
} | |
}; | |
Array.method('reduce', function (f, value) { | |
var i; | |
for (i = 0; i < this.length; i+= 1) { |
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
// Merged to master | |
// https://github.com/NeoCat/twicli/commit/24f73ae0ea054a33ed3e5ff83da28aaab641a061 |
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
powershell.exe -Command "& {Get-ChildItem|Where-Object{$_.Name -notmatch '^\.hg'}|Remove-Item -Recurse}" |