Tag Archives: web development
Simple Password Protection for a Directory Using .htaccess
Link
Simple Password Protection for a Directory Using .htaccess
The basic snippets are:
The .htaccess Code
The basic .htaccess configuration tells this directory to use basic authentication, what to title the login dialog and where to find the .htpasswd file.
AuthType Basic AuthName "restricted area" AuthUserFile /home/user_name/public_html/protected-dir/.htpasswd require valid-user
The .htpasswd Code
.htpasswd is simple a list of usernames and passwords in the format of: user_name:password. One entry per line.
your_user_name:secret_password another_user:another_password someone_else:I*3joidsl__2
Resource: David Wals Blog
Web Analytics 101: Definitions: Goals, Metrics, KPIs, Dimensions, Targets
Link
Web Analytics 101: Definitions: Goals, Metrics, KPIs, Dimensions, Targets
Avanish Kaushik provides some simple definitions, graphics and examples for common web analytics terms.
Here are the filtered key points:
Business Objectives:
This is the answer to the question: “Why does your website exist?”
Or: “What are you hoping to accomplish for your business by being on the web?”
Or: “What are the three most important priorities for your site?”
The objectives must be DUMB: Doable. Understandable. Manageable. Beneficial.
Goals:
Goals are specific strategies you’ll leverage to accomplish your business objectives. Do x, increase y, decrease z
Metric:
A metric is a number – a count or a ratio (typically seen in columns). Number of visits, unique visitors, pageviews.
Key Performance Indicator:
A key performance indicator (KPI) is a metric that helps you understand how you are doing against your objectives. Example: One of bestbuy.com’s KPIs is “Average order size”.
Targets:
Targets are numerical values you have pre-determined as indicators success or failure. Continueing his example above, target for the KPI of Average Order Size is $90.00.
Dimension:
A dimension is, typically, an attribute of the Visitor to your website (typically seen in rows). Keyword, referal source, location, campaign, web browser, screen resolution, activity (played video, posted comment)
Segments:
A segment contains a group of rows from one or more dimensions. Examples: Visitors from a specific location, visitors who spend over X minutes on the site, visitors who click more than X pages, visitors who searched a specific key phrase.
Check out the full Web Analytics 101 article for more detailed explanations and graphics.
Buffers, windows, and tabs | Arabesque
Link
Buffers, windows, and tabs | Arabesque
This post provides a good overview of some basic vim concepts. effectively using buffers, windows and tabs makes using vim much more efficient.
Buffers
A buffer in Vim is probably best thought of for most users as an open instance of a file, that may not necessarily be visible on the current screen.
Windows
A window in Vim is a viewport onto a single buffer. When you open a new window with :split or :vsplit, you can include a filename in the call.
Tabs
Finally, a tab in Vim is a collection of one or more windows. The best way to think of tabs, therefore, is as enabling you to group windows usefully.
Triggering Specific Transaction Responses Using Test Zip Codes for Authorize.net
Link
Triggering Specific Transaction Responses Using Test Zip Codes for Authorize.net
General Responses
ZIP CODE | RESPONSE CODE | RESPONSE TEXT | NOTES |
46282 | 2 | This transaction has been declined. | General bank decline |
AVS Responses
ZIP CODE | AVS RESPONSE | AVS STATUS | NOTES |
46206 | P | AVS Not Applicable | |
46203 | E | AVS data provided is invalid or AVS is not allowed for the card type that was used. | |
46207 | R | The AVS system was unavailable at the time of processing. | |
46204 | G | The card issuing bank is of non-U.S. origin and does not support AVS. | Not applicable to American Express |
46209 | U | The address information for the cardholder is unavailable. | |
46208 | S | The U.S. card issuing bank does not support AVS. | |
46205 | N | Address: No Match ZIP Code: No Match | |
46201 | A | Address: Match ZIP Code: No Match | |
46217 | Z | Address: No Match ZIP Code: Match | |
46211 | W | Address: No Match ZIP Code: Matched 9 digits | Not applicable to American Express |
46214 | X | Address: Match ZIP Code: Matched 9 digits | Not applicable to Visa or American Express |
CVV Responses
CARD CODE | CVV RESPONSE | CVV STATUS |
900 | M | Successful Match |
901 | N | Does NOT Match |
904 | P | Is NOT Processed |
902 | S | Should be on card, but is not indicated |
903 | U | Issuer is not certified or has not provided encryption key |
Partial Authorization Responses
ZIP CODE | RESULT | REMAINING BALANCE | AUTHORIZED AMOUNT |
46225 | Partial Authorization | n/a | $1.23 |
46226 | Partial Authorization | $1.23 | Full amount |
46227 | Partial Authorization | -$1.23 (negative balance) | Full amount |
46228 | Partial Authorization | $0 | Full amount |
How to run a single rails unit test – Flavio Castelli
Link
How to run a single rails unit test – Flavio Castelli
Examples of running a single unit test with Ruby on Rails.
Git Cherry Picking: Move small code patches across branches | TechnoSophos
Link
Git Cherry Picking: Move small code patches across branches | TechnoSophos
How to checkout only the changes from a specific commmit:
Get the commit SHA1 and run:
git cherry-pick 5d3e1b6
Download file with php and curl
This is a great tutorial on using cURL in php and downloading a file. http://phpsense.com/php/php-curl-functions.html I was able to download a zip file to my web server from a website using this code. Sample code: ————- <?php /*** Initialize the … Continue reading