Personal Online Reference

|

Please ignore this page, It's just a place for me to put things that I know I will forget :)


CSS

code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html lang="en"> <head> <title>center contents</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <style type="text/css"> <!-- body {text-align: center} #alignment {text-align: left; margin: auto auto; width:60%;} p {background:red;} -->

</style>

</head>
<body>
<div id="alignment">
<p>contents
</p>
</div>
</body>

</html>



*nix

untar & zip

tar -zvxf

tar and gzip

tar cvf - files... | gzip -9 > tarfile.tar.gz

Easy Urpmi
http://plf.zarb.org/~nanardon/index.php


mysql / perl


# Making placeholders
$str = join (",", ("?") x @values);


# seperate user/pass info into dir outside web dir.
# Cookbook.pm - library file with utility routine for connecting to MySQL

package Cookbook;


use strict;
use DBI;

# Establish a connection to the cookbook database, returning a database
# handle. Dies with a message if the connection cannot be established.

sub connect
{
my $db_name = "cookbook";
my $host_name = "localhost";
my $user_name = "cbuser";
my $password = "cbpass";
my $dsn = "DBI:mysql:host=$host_name;database=$db_name";

return (DBI->connect ($dsn, $user_name, $password,
{ PrintError => 0, RaiseError => 1}));
}

1; # return true


#! /usr/bin/perl -w
# harness.pl - test harness for Cookbook.pm library

use strict;
use lib qw(/usr/local/apache/lib/perl);
use Cookbook;

my $dbh = Cookbook::connect ( );
print "Connected\n";
$dbh->disconnect ( );
print "Disconnected\n";

exit (0);


Alter Table - Add Column Syntax

mysql> alter table [tbl_name] add column [col_name] [int(1)];


MySQL Search & Replace

UPDATE tablename SET fieldname=REPLACE(fieldname, 'oldstring', 'newstring');


Perl

Perl Books Online

http://www.unix.org.ua/orelly/perl/


Getopt::Long Example.

use strict;
use warnings;
use Getopt::Long;
use vars qw($opt_u $opt_h $opt_a $opt_l);

#Note that l=s says that l requires an option
# l:s means that it is optional
# I have chosen the option method here so that
# I can handle it how I want programatically
&GetOptions('l:s','u','h','a') || exit 1;

print "Option found: u\n" if ($opt_u);
print "Option found: h\n" if ($opt_h);
print "Option found: a\n" if ($opt_a);
if (defined $opt_l) {
print "Option found: l\n";
if ($opt_l) {
print " with value: $opt_l\n";
} else {
print " No value specified.\n";
}
}




http://www.belarc.com/ - computer hardware inventory.... When working with unfamilliar systems



business


an executive summary:

  • what your product, process, or service is
  • your target market and the market's key characteristics
  • the strategy behind the plan
  • brief description of the management team and why they are suited to the plan (list past successes)
  • amount of $$ that will be used
  • how the investors will get their investment back, and
  • a brief financial history, if appropriate.

    Real Estate

    MIT Software

    camera

    page

    manual


    FlashVars

    http://www.macromedia.com/cfusion/knowledgebase/index.cfm?id=tn_16417

    must be in both EMBED and PARAM Tags.... See link for reference.


    PHP



    <?php
    list($k, $v) = $_GET['word'];
    echo "<a href=\"{$_SERVER['PHP_SELF']}?$k=$v\">$v</a>";
    ?>

  • Ruby/Gem/Rails


    gem update --system


    Use the New Gem Freezing Feature

    rake freeze_gems

    This copies all the rails gems into ./vendor (and any other gems mentioned in environment.rb).
    Copy the contents of ./vendor/rails to Your Host
    You Win!

    About this Entry

    This page contains a single entry by Will published on January 1, 0001 3:10 PM.

    First Entry is the next entry in this blog.

    Find recent content on the main index or look in the archives to find all content.

    Powered by Movable Type 4.01
    Support this site by opening up a hosting account with site5.com
    Powered By Site5.com