Skip to content

Instantly share code, notes, and snippets.

View anotheremily's full-sized avatar

emily anotheremily

  • Las Vegas, Nevada USA
View GitHub Profile
### Keybase proof
I hereby claim:
* I am zyoung on github.
* I am zyoung (https://keybase.io/zyoung) on keybase.
* I have a public key whose fingerprint is 5C1F 2DA9 67AB 040A 2640 FCA8 AE3C 5206 DBC6 9F8C
To claim this, I am signing this object:
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;
function Stack() {
this.reset();
}
Stack.prototype.pop = function () {
if (this.empty() !== true) {
this.length -= 1;
return this.items.pop();
}
return undefined;
function Queue() {
this.reset();
}
Queue.prototype.dequeue = function () {
if (this.empty() !== true) {
this.length -= 1;
return this.items.shift();
}
return undefined;
git clone git://github.com/ry/node.git
cd node
./configure
make
sudo make install
/**
* 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
/**
* 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 = '#';
/**
* 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;
/**
* 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",
<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' =