Tag Archives: development

casperJS – passing parameters on the command line (cli)

I like using the command line / shell to pass information to scripts and programs. Sure it has limitations but it’s generally pretty effective.

Each language seems to have it’s own method of handing them, and CasperJS does not seem to be any different. What I did find a little different from others, is how CapserJS splits out arguments from parameters (options in CapserJS speak).

Passing Arguments

Passing arguments is a fairly simple affair. His an example of passing some arguments on the command line to a screen capture utility I’m working on:

casperjs generic.screenshot.cjs http://www.someplace.com save_local
[
“http://www.someplace.com”,
“save_local”
]

They are placed into a list (integer indexed array), and can be addressed in the following way:

url = casper.cli.args[0];
mode = casper.cli.args[1];

This would result in ‘url’ = ‘http://www.someplace.com’ and ‘mode’ = ‘save_local’. Pretty straight forward. One major drawback, you must know the order of the parameters, add a new one, get one out of place and the entire house of cards collapses.

There is a better way!

Passing Parameters (options)

Passing options is a fairly simple affair as well. His an example of passing some option on the command line:

casperjs generic.screenshot.cjs –url=http://www.someplace.com –mode=save_local
{
“casper-path”: “/opt/casperjs”,
“cli”: true,
“url”: “http://www.someplace.com”,
“mode”: “save_local”
}

Note: “casper-path” and “cli” are injected automatically

They are placed into an array, and can be addressed in the following way:

url = casper.cli.options[‘url’];
mode = casper.cli.options[‘mode’];

This would result in ‘url’ = ‘http://www.someplace.com’ and ‘mode’ = ‘save_local’. Now, you do not need to worry about ordering of options, and adding more options doesn’t mean that you’ll have to worry about re-coding the variable localization, ordering etc. It’s also CLEAR to any user how the cli is formatted.

Now, go forth and parse, screen capture and automate your testing until your heart is content!

Help for Geeks – My Development Bookmarks

I’ve thought about this many times. What info do I find useful, and would other geeks find it useful too?   Perhaps.    In that spirit here is my current list of Development related bookmarks.   Slightly organized.  You might find some nuggets of info in here that relates to a project you are working on.  Or it might spark and idea to build something new, or re-design a process that is not as optimal is you’d like it to be.

I hope some of these help, as they have helped me over the years.  One note though, I removed all my links to PHP development.  I just can’t stand using it any more, it’s just too easy to PWN.


Apache

libapreq2-2.08: libapreq2: Apache2::Request
Apache2::RequestRec – Perl API for Apache request record accessors – search.cpan.org
Apache2::AuthCookie – Perl Authentication and Authorization via cookies – search.cpan.org
Adventures in the Land of Apache and mod_perl
perl. Computational Chemistry List, perl, mod_perl, modperl2, cgi, Apache, cgi, forms
Combining Apache and Perl
Useful OpenSSL Commands
Creating Self-Signed Certs on Apache 2.2 | CB1, INC.
CB1, INC. is a Minneapolis based software and consulting company specializing in custom development and systems integration.
NSS and SSL Error Codes
Smart HTTP and HTTPS RewriteRule Redirects
Smarter SSL HTTPS to HTTP Redirections in .htaccess using RewriteRule to set an environment variable
Apache Week. Using User Authentication
The O’Reilly Network has teamed with Red Hat Apache Week, the leading commercial Apache site to offer comprehensive Apache information and resources. Apache Week offers news, feature articles, reviews, resources, and documentation.
htaccess rewrite tips using RewriteRule and RewriteCond for .htaccess mod_rewrite
mod_rewrite tips and tricks for .htaccess files using RewriteBase, RewriteCond, RewriteEngine, RewriteLock, RewriteLog, RewriteLogLevel, RewriteMap, RewriteOptions, and RewriteRule
mod_perl: mod_perl 2.0 Server Configuration
mod_perl documentation: This chapter provides an in-depth mod_perl 2.0 configuration details.
Dr. Dobb’s | A mod_perl 2 Primer | December 1, 2004
Though it’s technically not quite ready for prime time, it’s high time we all got a taste of the next version of mod_perl.
Apache2::Status 4.00
apache 2: “private key not found”

HTML / CSS

CSS2 Reference
Free HTML XHTML CSS JavaScript DHTML XML DOM XSL XSLT RSS AJAX ASP ADO PHP SQL tutorials, references, examples for web building.
CSS Tutorial – Border
Place customized CSS borders around your HTML elements with the CSS Border attribute.
How can I make just one cell in an HTML table bordered, or just one side of a cell bordered?
CSS Positioning Properties
Free HTML XHTML CSS JavaScript DHTML XML DOM XSL XSLT RSS AJAX ASP ADO PHP SQL tutorials, references, examples for web building.
Ajaxload – Ajax loading gif generator
Ajaxload – Ajax loading gif generator
workalike for top.location.watch(“href”,fn) in IE? – JavaScript
workalike for top.location.watch(“href”,fn) in IE?. Get answers to your questions in our JavaScript forum.
window.onbeforeunload [javascript] [form]
HTML FIELDSET TAG
Free HTML XHTML CSS JavaScript DHTML XML DOM XSL XSLT RSS AJAX ASP ADO PHP SQL tutorials, references, examples for web building.
wg:Bubble Tooltips
web graphics is a compilation of hypertext design resources, links, and commentary.
lixlpixel CSS tooltips
pure CSS pop up tooltips with clean semantic code – valid XHTML – degrades nicely
Simple Round CSS Links ( Wii Buttons )
HTML URL-encoding Reference
Free HTML XHTML CSS JavaScript DHTML XML DOM XSL XSLT RSS AJAX ASP ADO PHP SQL tutorials, references, examples for web building.
Custom error responses
CSS and round corners: Making accessible menu tabs
Find out how to lose the box layout of your CSS pages and make great menu tabs
A List Apart: Articles: Sliding Doors of CSS
Must CSS layouts be flat and boxy? Nope! Bowman shows how to create slick tabbed navigation using CSS and structured XHTML lists.
Light Weight Low Tech CSS Tabs
An example of light weight tabs by combining the Sliding Doors method with the Mountaintop corners idea.
A List Apart: Articles: Mountaintop Corners
Using CSS to create standards-compliant, mountain top corners
Setting a Minimum Body Height:Solving the ‘Height’ Mystery
W3C Markup Validator
W3C’s easy-to-use HTML validation service, based on an SGML parser.
Private RSS Feeds: Support for security in aggregators – silverorange labs
We’ve been experimenting with security options for RSS feeds for our intranet product. However, we found that there weren’t many resources or guidelines for how encryption or authentification should be handled (either in feeds or in readers/aggregators).
The W3C CSS Validation Service
The Art of Web ~ CSS: border-radius and -moz-border-radius
One of the most keenly-anticipated CSS properties is border-radius. It’s not yet available in Internet Explorer, but there is limited support in Firefox (-moz-border-radius) and Safari (WebKit). Discussion and examples.
removeChild
javascript document object javascript document object model sans serif font document object model removechild: Removing objects from a web page.
Adding elements to the DOM
Click here for an introductory tutorial on the DOM of IE 5/ NS 6, and how to program using it
JavaScript tutorial – DOM nodes and tree
HTTP State Management Mechanism [RFC-Ref]
phone number validation
phone number validation
Validating with XML Schema
HTML Color Names
Free HTML XHTML CSS JavaScript DHTML XML DOM XSL XSLT RSS AJAX ASP ADO PHP SQL tutorials, references, examples for web building.
CSS Color Names
Free HTML XHTML CSS JavaScript DHTML XML DOM XSL XSLT RSS AJAX ASP ADO PHP SQL tutorials, references, examples for web building.
CSS Image Opacity / Transparency
Free HTML XHTML CSS JavaScript DHTML XML DOM XSL XSLT RSS AJAX ASP ADO PHP SQL tutorials, references, examples for web building.

JavaScript

O’Reilly Network — Dynamic HTML Tables: Improving Performance
The widespread browser adoption of the W3C Document Object Model (DOM) and other de facto standards have given developers many ways to repopulate a table. So what’s the best approach? Danny Goodman, author of JavaScript & DHTML Cookbook, investigated…
Managing the Dynamic created HTML table thru javascript – SEO Chat
Managing the Dynamic created HTML table thru javascript- HTML Coding. Visit SEO Chat to discuss Managing the Dynamic created HTML table thru javascript
JavaScript Kit- Text Object
Click here for a complete JavaScript Reference, including array, string, document. window, and more.
How do you know what button was pressed in the submit? – JavaScript
How do you know what button was pressed in the submit?. Get answers to your questions in our JavaScript forum.
The JavaScript Source: Forms : Auto Email Link
Automatically creates a new e-mail utilizing the user’s default e-mail client. The script fills in the subject line and adds the URL of the current Web page to the body. Note: May not be compatible with all e-mail clients.
Javascript – Early event handlers
Javascript – The events
Javascript – Introduction to Events
The JavaScript Source: Forms: Form Focus
Places the focus on the first editable field in a form on any web page. Efficient!
JavaScript Help: How to access parent elements from a child window or frame
Popup Window Tutorials
This series of tutorials takes you step by step thrugh thedifferent ways that you can create and modify popup windows.
DevGuru JavaScript PROPERTY: document::forms
Award-winning web developers’ resource: over 3000 pages of quick reference guides, tutorials, knowledge base articles, Ask DevGuru, useful products.
ActiveWidgets • sorting • download data xls

JAVA

java integer to string – Google Search
Java Dynamic Management Kit 5.1 Release Notes
NetBeans IDE 6.0.1 Download
NetBeans IDE 6.0.1 Download
Welcome to JavaWorld.com
Solutions for Java developers
Your Source for Java Information – Developer.com’s Gamelan.com
Get the latest Java news, articles, whitepapers, analyst reports, and more. This is your one stop for information that will help you make decisions related to Java.
String (Java Platform SE 6)
Arrays (The Java™ Tutorials > Learning the Java Language > Language Basics)
StringBuffer (Java 2 Platform SE 5.0)
Throwable (Java 2 Platform SE v1.4.2)
NetBeans Forums – How to use Netbeans packages?
Javadoc Guide
System Properties (The Java™ Tutorials > Deployment > Doing More With Rich Internet Applications)
Adding Classes to the JAR File’s Classpath (The Java™ Tutorials > Deployment > Packaging Programs in JAR Files)
NetBeans Forums – Create manifest, jar and class file in netbeans
Packaging and Deploying Desktop Java Applications
Creating executable JAR files and deploying netbeans projects
Understanding the Manifest
JAR files can support a wide range of functionality, including electronic signing, version control, package sealing, extensions, and others. What gives JAR files the ability to be so versatile? The answer is embodied in the JAR file’s manifest.
http://java.sun.com/j2se/1.3/docs/guide/jar/jar.html#JAR%20Manifest
JAVA Illegal Start of Expression Error – Java
JAVA Illegal Start of Expression Error Java
do-jar-with-main class ‘manifest.available+main.class’ not set. – Google Search
Formatted Printing for Java (sprintf)
The C language utility sprintf is for formatting strings of characters and numbers. This article documents the use of a Java programming language class, PrintfFormat, whose behavior is based on the sprintf specification. Source code is provided.
Java Tips – How to align your components in horizontal or vertical layout
Java Tips — Java, Java, and more Java, How to align your components in horizontal or vertical layout
Java Tips – PointBase Embedded
Java Tips — Java, Java, and more Java, PointBase Embedded
Programming with Java in 24 Hours: Building a Complex User Interface
Questions, corrections and clarifications for hour 16 of the book Teach Yourself Java 6 in 24 Hours by Rogers Cadenhead. The book teaches Java 6 programming for non-programmers, new programmers who hated learning a language, and experienced programmers who want to quickly get up to speed.
Java look and feel Graphics Repository
Welcome to the Java Software Human Interface Group’s Java look and feel Graphics Repository pages.

MySQL

MySQL Stored Procedures / Functions
MySQL AB :: MySQL Forums :: Install :: Comments on my.cnf for high insert volume db
MySQL Configuration
MySQL Performance Blog » Should MySQL and Web Server share the same box ?
MySQL AB :: Index update with update statement
MySQL AB :: MySQL 5.0 Reference Manual :: 18 Stored Procedures and Functions
MySQL Stored Procedures
MySQL Server Tweaking Basics – Admin Zone Forums
This is a basic guide to understanding what the directives in your my.cnf mean, and what they do. We’ll also try to give some general
mySql — CHECK TABLE Syntax
Live Backups of MySQL Using Replication
Russell Dyer, author of MySQL in a Nutshell, walks through the process of using replication for data backups in MySQL.
MySQL AB :: MySQL 5.0 Reference Manual :: B.1.4.1 How to Reset the Root Password
MySQL – best methods for backups
Best way to backup, MySQL/VPS etc Linux
MySQL AB :: MySQL 5.0 Reference Manual :: 12.2.17.1 Troubleshooting InnoDB Data Dictionary Operations
ERROR: database: mysql_error: Can’t connect to MySQL server on ‘10.10.0.7 (110) – Snort Forums Archive
The open source Snort Intrusion Detection and Prevention system is the most flexible and widely deployed solution available.
How to fix error 134 from storage engine – MySQL
How to fix error 134 from storage engine. Get answers to your questions in our MySQL forum.
MySQL AB :: MySQL 5.0 Reference Manual :: 12.2.3 InnoDB Configuration
MySQL Stored Procedures: Part 2
Part 2 of MySQL Stored Procedures covers some more advanced concepts, including conditions and loops.
MySQL AB :: MySQL 5.0 Reference Manual :: 10.11.1 GROUP BY (Aggregate) Functions
Select INTO OUTFILE
MySQL :: stored procedure to list stored procedures
MySQL :: MySQL 5.1 Reference Manual :: 10.4.5 The SET Type
InnoDbEngineStatusAndTuning < Development < TWiki
MySQL :: MySQL 5.0 Reference Manual :: 13.2.11 InnoDB Performance Tuning Tips
Regular Expressions in MySQL
Regular Expressions in MySQL
Dan Winchester – MySQL date_format
MySQL :: MySQL 5.0 Reference Manual :: B.1.2.11 Communication Errors and Aborted Connections
MySQL Bugs: #36910: Mysql Server has gone away
Mysql_User_Add < Development < TWiki
mytop – a top clone for MySQL
Using ON DUPLICATE KEY UPDATE to improve MySQL Replication Performance « Kevin Burton’s NEW FeedBlog
MySQL :: MySQL 5.1 Reference Manual :: 13.11 The FEDERATED Storage Engine
MySQL :: MySQL 5.1 Reference Manual :: 11.4.2 Regular Expressions
MySQL :: MySQL 5.1 Reference Manual :: 18.2 Partition Types

PERL

Proc::ProcessTable – Perl extension to access the unix process table – search.cpan.org
Proc::ProcessTable::Process – Perl process objects – search.cpan.org
perlvar
Perl 5.8 Documentation – Signals
Perl 5.8 Documentation – Signals
khtml2png – Make screenshots from webpages
Sys::Load – Perl module for getting the current system load and uptime – search.cpan.org
The CPAN Search Site – search.cpan.org
Perl HTML::Form
Perl 5.8 Documentation – HTML::Form – Class that represents HTML forms
LWP Cookbook – URL explosion
Reaping Zombies
PERL ‘UTF-16LE’ – MarkMail
urlencode / urldecode in Perl | melecio.org
Regular Expression Examples
how check new URL of redirected page
Getopt::Long – perldoc.perl.org
perl.com: Beginners Intro to Perl – Part 6
Doug Sheppard shows us how to activate Perl’s built in security features.
How can I make one class extend another one?
XML::Generator – Perl extension for generating XML – search.cpan.org
Free Perl source library: unescape
subroutine name: unescape decode URL-encoded string
rami.info » URLEncode And URLDecode For Perl
File Tests in Perl
File Tests in Perl
Page 2 – Build a Perl RSS Aggregator with Templating Tools
Page 2 – Build a Perl RSS Aggregator with Templating Tools
perl.com: Preventing Cross-site Scripting Attacks
Paul Lindner, author of the mod_perl Cookbook, explains how to secure our sites against Cross-Site Scripting attacks using mod_perl and Apache::TaintRequest
libapreq2-2.08: libapreq2: Apache2::Upload
binary data handling – examine a .gif file – Perl example
binary data handling – examine a .gif file – Perl example
PERL — Conversion Functions
LWP::UserAgent
Web user agent class
Fastest XML Parser ?

mod_perl

Practical mod_perl: 6.3.3.6. A third solution
This solution makes use of package-name declaration in the …
mod_perl: HTTP Handlers
mod_perl documentation: This chapter explains how to implement the HTTP protocol handlers in mod_perl.
Installing mod_perl from RPM | O’Reilly Media
It’s easy to install mod_perl using the Red Hat package manager. Configuring it is trickier.
mod_perl: Apache2::RequestRec – Perl API for Apache request record accessors
mod_perl documentation: <code>Apache2::RequestRec</code> provides the Perl API for Apache request_rec object.
How to extract name/value pairs from the query string? | ModPerl | ModPerl
How to extract name/value pairs from the query string? ModPerl ModPerl
mod_perl: Code Snippets
mod_perl documentation: A collection of mod_perl code snippets which you can either adapt to your own use or integrate directly into your own code.

XML

Helpful XML related sites
iWeb Toolkit: XML Validator
XML Schema (REC (20010502) version, as amended) Checking Service
XML Schema Examples
XML::Generator
Perl extension for generating XML
XML DOM – Validate XML
Free HTML XHTML CSS JavaScript DHTML XML DOM XSL XSLT RSS AJAX ASP ADO PHP SQL tutorials, references, examples for web building.

Swish-e

Swish-e :: Re: performance aspects
Swish-e Lightning Talk
Swish-e :: Re: running out of memory during merge
Swish-e :: INSTALL – Swish-e Installation Instructions
Connecting Linux or UNIX system to Network attached storage device
Network attached storage (NAS) allows using TCP/IP network to backup files. This enables multiple servers in IDC to share the same storage for backup at once, which minimizes overhead by centrally managing hard disks. NAS …
How do I access NAS server using automount?
Network-attached storage commonly used to store backup and other shared files over TCP/IP network. For example: i) Corporate e-mail system with multiple, load-balanced webmail servers ii) Load-balanced web servers access the same contents from NAS …
SmallNetBuilder
SmallNetBuilder provides networking and IT news, reviews, help and information for professional and &quot;prosumer&quot; SOHO and SMB users.
IP Subnet Calculator
Online IP Subnet Calculator
10 Steps to Installing PostgreSQL
Remote Network Commands | Linux Journal
Cikul » How to change hostname in CentOS
Thecus User Group – NFS mount failed permission denied
Thecus 1U4500 – Enable root SSH
Wahoo’s Word » Using watch to monitor Javascript
Ascii control codes (control characters, C0 controls)
DOM Based Cross Site Scripting
document.body, doctype switching, and more | evolt.org
A world community for web developers, evolt.org promotes the mutual free exchange of ideas, skills and experiences.
DOM:window.open – MDC
Welcome to Hadoop!
Internationalized domain name – Wikipedia, the free encyclopedia
Code Charts – Scripts
ISO 8859-1 Latin 1 and Unicode characters in ampersand entities
Dig Demonstrations
Re: say if grep can find non-ascii
http://www.ietf.org/rfc/rfc2181.txt
MIL-STD-498,MIL STD 498,MIL-STD,MIL-SPEC,MIL SPEC,Military Standards
MIL-STD-498,MIL-STD,MIL-SPEC,MIL STD,MIL SPEC,Military Standards for ISA
J-STD-016 & MIL-STD-498 vs. DOD-STD-2167A & 7935A
DOD Standards Procedures Collection Document Listing – Page 2
IHS, DOD STANDARDS (MILITARY/FEDERAL SPECS) – General Collection
Fred Morris, project management/distributed systems/practices
Info: (dir) Top
VICNET Help: Online – Web Design – .htpasswd encoder
reminders about programming: Fedora firewall setup is simple using built-in tools
Sample Usability Test Plan
FavIcon from Pics — free favicon.ico for your website (animated, static and marquee icons)
Free and easy to use online tool for creating favicons (.ico, animated, marquee and static) for browser address bars, favorites and tabs, from pictures, logos and other graphics.
How to Obscure Any URL
frames test page for harvesters
IP CIDR Subnet Calculator
Online IP CIDR / VLSM Supernet Calculator
DNS BIND named.conf Parameters
Copy files and directories recursively with tar – Tech-Recipes.com
Copying a directory tree and its contents to another filesystem using tar will preserve ownership, permissions, and timestamps. A neat trick allows using tar to perform a recursive copy without creating an intermediate tar file.
Scrum (development) – Wikipedia, the free encyclopedia
Searching your files with SWISH-E
Disk I/O
Installing and Configuring iptables
How to add an external USB hard drive to your Linux server (Redhat, CentOS, Ubuntu, Gentoo and SUSE) | my-whiteboard
Extenal USB hard disk is really useful (and inexpensive) for backing up your Linux server. Follow these steps to get it to work. 1, Buy a USB hard disk (I have
Which Web Browser is King? – Round 5: JavaScript Library and Framework Tests – OS, Software & Networking by ExtremeTech
Which browser is faster? IE7, Firefox 3, Google Chrome, Safari, or Opera? We run a bevy of tests to determine the king of the Web browser hill.
How to: Debug SSL certificate problems from the shell prompt
OpenSSL is a cryptography toolkit implementing the Secure Sockets Layer (SSL v2/v3) and Transport Layer Security (TLS v1) network protocols and related cryptography standards required by them. It also includes the openssl command, which provides a rich variety of commands You can use the same command to debug problems with SSL certificates. To test the secure connections to a server, type the following command at a shell prompt: openssl s_client -connect ssl.servername.com:443 Where, s_client : This implements a generic SSL/TLS client which can establish a transparent connection to a remote server speaking SSL/TLS. It’s intended for testing …
Ascii Table – ASCII character codes and html, octal, hex and decimal chart conversion
Ascii character table – ascii ascii ascii ascii and ascii…conversions
How to Copy Files Across a Network/Internet in UNIX/LINUX (Redhat, Debian, FreeBSD, etc) – scp tar rsync
HOWTO: Installing DenyHosts – Page 2 – Ubuntu Forums
Page 2- HOWTO: Installing DenyHosts Tutorials & Tips
sendmail Configuration
history–Show status of files and users
using rsync to copy files from one server to another
CVS Commands
FC5 Repositories & Updates
Multiple Bugzilla databases with a single installation
IP Address Lookup (IPv4 & IPv6)
Determines your IP address and shows information (host, location, whois…) about any IP address entered – Up to 10 IP addresses can be looked up at the same time
FC10 network setup repeatedly overwritten – FedoraForum.org
FC10 network setup repeatedly overwritten Installation Help
Interface Configuration Files
CVS revision numbers
CVS Branch and Merge example
CVS–Concurrent Versions System – Merging two revisions
Linux.com :: All about Linux swap space
When your computer needs to run programs that are bigger than your available physical memory, most modern operating systems use a technique called swapping, in which chunks of memory are temporarily stored on the hard disk while other data is moved into physical memory space. Here are some techniques that may help you better manage swapping on Linux systems and get the best performance from the Linux swapping subsystem.
Zone Files
HowTo Setup an NTP Daemon for Time Synchronization – SIPfoundry sipXecs IP PBX, The Open Source SIP PBX for Linux – Calivia
YAML Ain’t Markup Language (YAML) Version 1.1
Trouble editing whine.txt.tmpl – What variables can I use? – mozilla.support.bugzilla | Google Groups
The Cafes » Privacy Tip #3: Block Referer Headers in Firefox
Writing Software Requirements Specifications | A Technical Communication Community
DiG HOWTO
How to use dig to query DNS name servers.
Behavior Driven Development – Wikipedia, the free encyclopedia
Agile software development – Wikipedia, the free encyclopedia
Waterfall model – Wikipedia, the free encyclopedia