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
#!/bin/bash | |
# CouchDB install script | |
# For installing from SVN source | |
# Before running make sure CouchDB is not running | |
# Clean up old CouchDB files | |
find /usr/local -name \*couch* | xargs rm -rf | |
# Build |
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 Deque() { | |
this.reset(); | |
} | |
Deque.prototype.pop = Stack.prototype.pop; | |
Deque.prototype.push = Stack.prototype.push; | |
Deque.prototype.dequeue = Queue.prototype.dequeue; | |
Deque.prototype.enqueue = Queue.prototype.enqueue; | |
Deque.prototype.empty = Stack.prototype.empty; | |
Deque.prototype.reset = Stack.prototype.reset; |
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 Queue() { | |
this.reset(); | |
} | |
Queue.prototype.dequeue = function () { | |
if (this.empty() !== true) { | |
this.length -= 1; | |
return this.items.shift(); | |
} | |
return undefined; |
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 Stack() { | |
this.reset(); | |
} | |
Stack.prototype.pop = function () { | |
if (this.empty() !== true) { | |
this.length -= 1; | |
return this.items.pop(); | |
} | |
return undefined; |
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
git clone git://github.com/ry/node.git | |
cd node | |
./configure | |
make | |
sudo make install |
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
/** | |
* creates javascript that causes links with the class newWindow to open in a new browser window | |
* requires mootools v1.24 (core) | |
*/ | |
"use strict"; | |
function createLinkTargets() { | |
$(document.body).getElements( 'a.newWindow').each( function( el ) { | |
el.addEvent('click', function () { | |
var newWindow = window.open(el.getAttribute('href')); | |
el.href = '#'; |
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
/** | |
* creates rollovers on items with the class rollover | |
* requires mootools 1.24 (core) | |
* -the id of the class should be the image base name | |
* -the text in the link should be the alt text for the image | |
* | |
* variables: | |
* prefix - any prefix (path, button prefixes, etc.) that are before the id for the iamge | |
* filetype - include preceding .) | |
* onText - text for on state |
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
/** | |
* creates javascript that causes links with the class newWindow to | |
* open in a new browser window | |
* requires jquery | |
*/ | |
function createLinkTargets() { | |
$('a.newWindow').each(function() { | |
$(this).on('click', function () { | |
var newWindow = window.open($(this).attr('href')); | |
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
/** | |
* Creates rollover functionality in JavaScript | |
* requires JQuery | |
* Rollovers should by default have their off state as the | |
* original image src. Set the on and off markers with the | |
* variables on the first two lines. By default they are | |
* _on and _off (i.e. rollover_off.jpg, rollover_on.jpg.) | |
*/ | |
function createRollovers() { | |
var onText = "_on", |
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
<select name="state"> | |
<?php | |
$curState = (isset($_POST['state'])) ? $_POST['state'] : ''; | |
$states = array( 'AK' => 'Alaska', 'AL' => 'Alabama', 'AR' => 'Arkansas', 'AZ' => 'Arizona', 'CA' => 'California', 'CO' => 'Colorado', 'CT' => 'Connecticut', 'DC' => 'District of Columbia', 'DE' => 'Delaware', 'FL' => 'Florida', 'GA' => 'Georgia', 'HI' => 'Hawaii', 'IA' => 'Iowa', 'ID' => 'Idaho', 'IL' => 'Illinois', 'IN' => 'Indiana', 'KS' => 'Kansas', 'KY' => 'Kentucky', 'LA' => 'Louisiana', 'MA' => 'Massachusetts', 'MD' => 'Maryland', 'ME' => 'Maine', 'MI' => 'Michigan', 'MN' => 'Minnesota', 'MO' => 'Missouri', 'MS' => 'Mississippi', 'MT' => 'Montana', 'NC' => 'North Carolina', 'ND' => 'North Dakota', 'NE' => 'Nebraska', 'NH' => 'New Hampshire', 'NJ' => 'New Jersey', 'NM' => 'New Mexico', 'NV' => 'Nevada', 'NY' => 'New York', 'OH' => 'Ohio', 'OK' => 'Oklahoma', 'OR' => 'Oregon', 'PA' => 'Pennsylvania', 'RI' => 'Rhode Island', 'SC' => 'South Carolina', 'SD' => 'South Dakota', 'TN' => 'Tennessee', 'TX' => 'Texas', 'UT' = |
OlderNewer