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 | |
// Add ordinal suffix to day | |
function fnDay_Format($iday) | |
{ | |
if(empty($iday)) | |
die("No parameter passed to function."); | |
else | |
$iday = intval($iday); |
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 | |
/* | |
randomfile.php | |
A quickie script that will take all images in | |
current directory, back them up to ./Orig and | |
rename all files in parent directory w/ random | |
numbers. | |
Written: 12/27/2010 - Nicholas Kreidberg | |
Revised: 12/27/2010 - Nicholas Kreidberg |
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> | |
<html> | |
<head> | |
<meta http-equiv="Content-type" content="text/html; charset=utf-8"> | |
<title>@ Name Test</title> | |
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script> | |
<script type="text/javascript"> | |
function fnLink() | |
{ | |
$(".twitter").each(function() |
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 | |
// Convert PostgreSQL timestamp to human readable date | |
function fnDisplay_Timestamp($sDT) | |
{ | |
// Assuming $sDT is in format: YYYY-MM-DD HH:MM:SS.MS | |
if(empty($sDT)) | |
fnErr("No parameter passed to fnDisplay_Timestamp() function."); | |
$aDT = explode(' ', $sDT); |
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 | |
/* | |
Here is an example function call, array abbreviated for the example. | |
$afields = array("Jan"=>"January", "Feb"=>"February", "Mar"=>"March); | |
echo fnDisplay_DropDown($afields, "Months", "Mar", "required"); | |
Results in: | |
<select name="Months" class="required"> | |
<option value="Jan">January</option> | |
<option value="Feb">February</option> |
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/env ruby | |
/* Thanks to @TextMateUser for help with this. */ | |
/* Escape quotes */ | |
puts STDIN.readlines.collect{|line| line.gsub('"','\\"')} | |
/* Remove escaping */ | |
puts STDIN.readlines.collect{|line| line.gsub('\\"','"')} |
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 | |
//////////////////////////////////////////////////// | |
// Written By: Nicholas Kreidberg // | |
// Revised By: Nicholas Kreidberg // | |
// Revised On: 10/01/2010 // | |
// Desc: fnSanitizePost() takes a $_POST array & // | |
// sanitizes all strings for insertion into a db. // | |
// Call: $aclean_post = fnSanitizePost($_POST); // | |
//////////////////////////////////////////////////// |
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
# | |
# Ports to listen on | |
# | |
Listen 8888 | |
# | |
# Use name-based virtual hosting. | |
# |
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 | |
/* | |
A simple example including sample function call and array map below. | |
This routine can be easily extended/customized to suit more complex | |
or just individual needs for a given dataset/table. | |
*/ | |
function fnDB_Update($aFields, $aPost, $hDB, $sTable, $bQuery=TRUE) | |
{ |
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 | |
/* | |
csvparse.php | |
Function that will parse a CSV and insert | |
data into a postgres database. | |
Revised: 3/18/2011, Nicholas Kreidberg | |
CSV Structure [For This Example]: | |
1,1001,Description,Foo,Bar |
OlderNewer