Skip to content

Instantly share code, notes, and snippets.

View tamouse's full-sized avatar
🏠
Retired from Work

Tamara Temple tamouse

🏠
Retired from Work
View GitHub Profile
<?php
error_reporting(-1);
ini_set('display_errors',true);
ini_set('display_startup_errors',true);
function array_to_english ( $list, $glueword='and' ) {
$string = false;
@tamouse
tamouse / form1.php
Created September 26, 2012 20:35
Handling form validation with error messages near problem fields.
<?php
/**
* an example of validating a form and showing errors
* by the incorrect fields. This is just a fragment showing how one
* implement a scheme to provide error information close to the form
* field where the error has occured. This provides better usability
* for the user to see exactly where the error occured and what to do
* to fix it. What is presented here is conceptual only; actual
* hardened application code would be more complete.
*
@tamouse
tamouse / rsyncbackup.sh
Created September 30, 2012 10:43
my rsyncbackup script
#!/bin/bash
# Time-stamp: <2012-09-30 05:41:04 tamara>
#
# rsyncbackup - use rsync to make a backup
#
# Author: Tamara Temple <[email protected]>
# Created: 2012-06-01
# Copyright (c) 2012 Tamara Temple
# License: GPLv3
#
@tamouse
tamouse / .bashrc
Created October 1, 2012 05:27
unaltered .bashrc and .profile of newly created user that has bash_completion issues
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
[ -z "$PS1" ] && return
# don't put duplicate lines in the history. See bash(1) for more options
# ... or force ignoredups and ignorespace
HISTCONTROL=ignoredups:ignorespace
@tamouse
tamouse / locatecompletion.out
Created October 2, 2012 01:55
output of `locate completion`
/etc/bash_completion
/etc/bash_completion.d
/etc/bash_completion.d/abook
/etc/bash_completion.d/acroread.sh
/etc/bash_completion.d/ant
/etc/bash_completion.d/apache2.2-common
/etc/bash_completion.d/apache2ctl
/etc/bash_completion.d/apport_completion
/etc/bash_completion.d/apt
/etc/bash_completion.d/apt-build
@tamouse
tamouse / index.php
Created October 20, 2012 05:49
Quick 3 column table using PDO
<?php
/**
* quick 3 column table demo using PDO
*/
/* set error reporting for example -- omit in deployed application */
error_reporting(-1);
ini_set('display_errors',true);
ini_set('display_startup_errors',true);
@tamouse
tamouse / dw-post-58109.html
Created November 12, 2012 05:29
post content
<p style="text-align: center;"><a href="http://imgur.com/eFOaB"><img src='http://tamouse.org/wp-content/uploads/2012/11/eFOaB.jpg' alt='' /></a></p>
<div class="rtsocial-container rtsocial-container-align-right rtsocial-horizontal"><div class="rtsocial-twitter-horizontal"><div class="rtsocial-twitter-horizontal-button"><a title= "Tweet: I rather like this philosophy&#8230;" class="rtsocial-twitter-button" href= "http://twitter.com/share?text=I%20rather%20like%20this%20philosophy%26%238230%3B" rel="nofollow" target="_blank"></a></div><div class="rtsocial-horizontal-count"><div class="rtsocial-horizontal-notch"></div><span class="rtsocial-twitter-count">0</span></div></div><div class="rtsocial-fb-horizontal fb-light"><div class="rtsocial-fb-horizontal-button"><a title="Like: I rather like this philosophy&#8230;" class="rtsocial-fb-button rtsocial-fb-like-light" href="http://www.facebook.com/sharer.php?" rel="nofollow" target="_blank"></a></div><div class="rtsocial-horizontal-count"><div class="rtsocial-horizont
@tamouse
tamouse / output of 'php testmail.php "[email protected]"
Created November 16, 2012 08:15
testing PEAR::Mail with and without recipient
Recipient = [email protected]
DEBUG: Recv: 220 omta07.emeryville.ca.mail.comcast.net comcast ESMTP server ready
DEBUG: Send: EHLO localhost
DEBUG: Recv: 250-omta07.emeryville.ca.mail.comcast.net hello [71.63.215.130], pleased to meet you
DEBUG: Recv: 250-HELP
DEBUG: Recv: 250-AUTH LOGIN PLAIN
DEBUG: Recv: 250-SIZE 36700160
DEBUG: Recv: 250-ENHANCEDSTATUSCODES
DEBUG: Recv: 250-8BITMIME
@tamouse
tamouse / spending.rb
Created December 24, 2012 06:01
Simple ruby script to parse checking account history CSV file and print a summary of aggregated transactions
#!/usr/bin/env ruby
=begin
spending.rb -- show how I'm spending my money
usage:
spending.rb history.csv
=end
@tamouse
tamouse / output.txt
Created January 4, 2013 02:39
parsing some data in ruby
lval=addrmap_ntimc0
rval=insFld(foldersTree, gFld("ntimc0 @0x0.0x0.0x0", "ntimc0_doc.html#addrmap_ntimc0"))
lval=addrmap_ntimc0_ntimc_core
rval=insFld(addrmap_ntimc0, gFld("ntimc_core @0x0.0x0.0x0", "ntimc0_doc.html#addrmap_ntimc0_ntimc_core"))
lval=reg_ntimc0_ntimc_core_CFG
rval=insDoc(addrmap_ntimc0_ntimc_core, gLnk("R", "CFG @0x0.0x0.0x0", "ntimc0_doc.html#reg_ntimc0_ntimc_core_CFG"))
lval=…
rval=
lval=addrmap_ntimc1
rval=insFld(foldersTree, gFld("ntimc1 @0x1.0x0.0x0", "ntimc1_doc.html#addrmap_ntimc1"))