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
<!-- PHP --> | |
<?php echo date('Y'); ?> |
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
<div id="item4"> | |
<p> | |
Last Name <input type="text" name="lastname[]" value=""/> | |
First Name <input type="text" name="firstname[]" value=""/> | |
Pronunciation <input type="text" name="pronunciation[]" value=""/> | |
</p> | |
<p> | |
Last Name <input type="text" name="lastname[]" value=""/> | |
First Name <input type="text" name="firstname[]" value=""/> | |
Pronunciation <input type="text" name="pronunciation[]" value=""/> |
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
$('addMore').observe('click',function(evt){ | |
evt.stop(); | |
var template = '<p>Last Name <input type="text" name="lastname[]" value=""/> First Name <input type="text" name="firstname[]" value=""/> Pronunciation <input type="text" name="pronunciation[]" value=""/></p>'; | |
var insertPoint = this.up('p'); | |
(5).times(function(){ | |
insertPoint.insert({before:template}); | |
}); | |
}); |
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
<?php | |
require_once('lib/config.inc.php'); | |
$page_title = $page_header = SITE_NAME; | |
if(isset($_SESSION['flash'])){ | |
$flash = $_SESSION['flash']; | |
unset($_SESSION['flash']); | |
} | |
$out = '<p><a href="?action=login">Log in</a>, or <a href="?action=register">register here</a> to use the members-only features of this site.</p>'; | |
if(isset($_SESSION['current_user'])){ | |
if($_user = ActiveRecord::FindCookie()){ |
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
<?php | |
$out = ''; | |
if(isset($_GET['src']) && !empty($_GET['src']) && strstr($_GET['src'],'..') === false){ | |
if(file_exists('./' . $_GET['src'])){ | |
$out = file_get_contents('./' . $_GET['src']); | |
}else{ | |
$out = 'error traversing filesystem'; | |
} | |
}elseif(isset($_SERVER['HTTP_REFERER']) && $_SERVER['HTTP_REFERER'] != $_SERVER['REQUEST_URI']){ | |
$out = file_get_contents($_SERVER['HTTP_REFERER']); |
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 list = $$('#yourBox li'); | |
list.each(function(elm){ | |
elm['keys'] = elm.innerHTML.stripTags().toLowerCase(); | |
}); | |
var lastValue = $F("filter"); | |
$('filter').observe('keyup', function(e) { | |
var value = this.value.toLowerCase(); | |
if (value !== lastValue) { | |
list.each(function(elm) { | |
if (elm.keys.include(value)) { |
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 f = $('yourFooterName'); | |
var t = f.getHeight(); | |
var y = document.viewport.getHeight(); | |
var h = document.viewport.getScrollOffsets()[1]; | |
if (Prototype.Browser.MobileSafari) h = window.pageYOffset; | |
f.setStyle({"top":parseInt(y - t + h,10).toString() + "px"}); | |
Event.observe(window,"scroll",function(evt){ | |
var y = document.viewport.getHeight(); | |
var h = document.viewport.getScrollOffsets()[1]; | |
if (Prototype.Browser.MobileSafari) h = window.pageYOffset; |
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 PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" | |
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> | |
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/prototype/1.6/prototype.js"></script> | |
<title>Placeholder Text</title> | |
<script type="text/javascript" charset="utf-8"> |
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
#models/document.rb | |
class Document < ActiveRecord::Base | |
has_attached_file :pdf,:styles => { :text => { :fake => 'variable' } }, :processors => [:text] | |
#more class stuff here | |
end |
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 SetCSSAttribute(tag, attributeName, attributeValue) { | |
// Sets a "CSS" attribute such as "position:absolute" in a tag value | |
// Passing an attribute value of null removes that attribute entirely | |
if (tag==null) return; | |
var tagField = tag['style']; | |
if (tagField == null){ | |
tag['style'] = '"'+attributeName+':'+attributeValue+'"'; | |
}else{ | |
var tagField = tagField.toString(); | |
var pairs = tagField.slice(1,-1).split(';'); |