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
<!DOCTYPE html> | |
<head> | |
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> | |
<script type="text/javascript"> | |
var get_servlet_call = function (url) { | |
$.get (url, function (data) { | |
// this callback function is called on successful return of the url passed to $.get | |
// function (data) is the callback here — in javascript it's considered an anonymous function. | |
alert(data); |
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
String.prototype.validate = function (regex) { | |
var pattern = { | |
zip: /^\d{5}([\-])?$/, | |
email: /^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/i, | |
ip: /(?:\d{1,3}\.){3}\d{1,3}/ | |
}; | |
return pattern[regex].test(this.trim()); | |
} |
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
> console.log(util.inspect(Date, true, null)) | |
{ [Function: Date] | |
[now]: { [Function: now] [arguments]: null, [length]: 0, [name]: 'now', [caller]: null }, | |
[arguments]: null, | |
[UTC]: { [Function: UTC] [arguments]: null, [length]: 7, [name]: 'UTC', [caller]: null }, | |
[length]: 7, | |
[name]: 'Date', | |
[prototype]: | |
{ Invalid Date | |
[constructor]: [Circular], |
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
<script type="text/javascript"> | |
var client = new XMLHttpRequest(); | |
client.open("GET", "http://zip.elevenbasetwo.com?zip=48867", true); | |
client.onreadystatechange = function () { | |
if(client.readyState == 4) { | |
alert(client.responseText); | |
}; | |
}; | |
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
curl http://api.nodejitsu.com -H 'user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_3) AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0.963.83 Safari/535.11' -v |
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
[ { '@': | |
{ b1: '475174', | |
start_tfs_zulu: '2012-04-17T03:12:59Z', | |
event: 'Single', | |
start_tfs: '231259', | |
num: '75', | |
b2: '460026', | |
pitcher: '543022', | |
batter: '475174', | |
b3: '', |
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 build_query = function (obj, num_prefix, temp_key) { | |
var output_string = [] | |
Object.keys(obj).forEach(function (val) { | |
var key = val; | |
num_prefix && !isNaN(key) ? key = num_prefix + key : '' |
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
<VirtualHost *:80> | |
ServerName mtambo.com | |
ServerAlias www.mtambo.com | |
DocumentRoot /var/www/mtambo.com/htdocs | |
ErrorLog /var/www/mtambo.com/logs/error.log | |
CustomLog /var/www/mtambo.com/logs/acomess.log common | |
</VirtualHost> |
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
NameVirtualHost *:80 | |
<Directory /var/www/> | |
AllowOverride All | |
</Directory> | |
<VirtualHost *:80> | |
</VirtualHost> | |
Include sites-enabled/* |
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
if (err || !files) return (err ? console.log(err) : (function() {throw new Error('no files')})()) |