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
#!/usr/bin/perl | |
$foo = "alert ('foo');"; | |
open(FH, "| java -jar yuicompressor-2.4.2.jar --type js"); | |
print FH $foo; | |
while(<FH>){ | |
print $_; | |
} | |
print "\n"; |
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
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> | |
<soap:Body> | |
<HelloWorldResponse xmlns="http://www.guru4.net/"> | |
<HelloWorldResult>Hello World!</HelloWorldResult> | |
</HelloWorldResponse> | |
</soap:Body> | |
</soap:Envelope> |
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
$input = "some text"; | |
$query = "select centroid.latitude, centroid.longitude from geo.places where text='$input'"; | |
$url = "http://query.yahooapis.com/v1/public/yql?q=" . urlencode($query) . "&format=json&callback="; | |
$ch = curl_init($url); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); | |
$response = curl_exec($ch); |
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
$ch = curl_init(); | |
$query = 'select * from search.web where query="pizza"'; | |
$url = "http://query.yahooapis.com/v1/public/yql?q=" . urlencode($query) . "&diagnostics=false&env=store://datatables.org/alltableswithkeys&format=json"; | |
curl_setopt($ch, CURLOPT_URL, $url); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); | |
curl_setopt($ch, CURLOPT_HEADER, 0); | |
$response = curl_exec($ch); |
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 bignum = 1e300; | |
var ∞ = 1e400; //Infinity | |
alert(∞ - bignum); //Infinity |
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 data = []; | |
for (p in parameterMap) { | |
data.push(p + "=" + encodeURIComponent(parameterMap[p])); | |
} | |
data = data.join("&"); |
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 httpClient = http.createClient(80, host); | |
var request = httpClient.request("POST", urlpath, {"host": host, "Content-Length": data.length, "Content-Type": "applicaiton/x-www-form-urlencoded"}); | |
request.write(data); | |
request.addListener('response', function (response) { | |
sys.puts("STATUS: " + response.statusCode); | |
sys.puts("HEADERS: " + JSON.stringify(response.headers)); | |
response.setBodyEncoding("utf8"); | |
response.addListener("data", function (chunk) { | |
sys.puts("BODY: " + chunk); | |
}); |
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 data = ""; | |
for (p in parameterMap) { | |
data += p + "=" + encodeURIComponent(parameterMap[p]) + "&"; | |
} | |
//kill the trailing & | |
data = data.slice(0,-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
var msgStr = msg.slice(0,5); | |
console.log(sys.inspect(msgStr)); | |
var a = msgStr.toString('ascii', 0, msgStr.length); | |
console.log(sys.inspect(a)); | |
for (i=0;i<a.length;i++) { | |
console.log(a.charCodeAt(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
wifi-e-135-251:~/Code/node_pcap(master) $ sudo find / -name "pcap.h"Password: | |
/Developer/SDKs/MacOSX10.4u.sdk/usr/include/pcap.h | |
/Developer/SDKs/MacOSX10.5.sdk/usr/include/pcap.h | |
/opt/local/include/pcap/pcap.h | |
/opt/local/include/pcap.h | |
/opt/local/var/macports/software/libpcap/0.9.8_0/opt/local/include/pcap.h | |
/opt/local/var/macports/software/libpcap/1.0.0_0/opt/local/include/pcap/pcap.h | |
/opt/local/var/macports/software/libpcap/1.0.0_0/opt/local/include/pcap.h | |
/opt/local/var/macports/software/libpcap/1.1.1_0/opt/local/include/pcap/pcap.h | |
/opt/local/var/macports/software/libpcap/1.1.1_0/opt/local/include/pcap.h |
OlderNewer