Categories Archives: Web development

Color survey

Color is subjective and people see colors differently sometimes wildly differently. Where someone sees the color red a different person will see orange or yellow. This survey is designed to find a common ground for defining color names. I didn’t some up with this test, it was stolen directly from Randall Patrick Munroe (XKCD) and he [...]

Our privacy policy: We sell your data. You get our content for “free.” Deal?

You have no expectation of privacy. We will collect any and all information you or your computer is willing to give us and do whatever we want with that information. Use of this site is entirely optional. Use at your own risk. Today on Slashdot they have an article on privacy policy and it got me thinking [...]

Interesting Friday

Interesting Friday, I’m going to try to make a new post once a week on Friday of all the interesting things that I have found over the week. People to follow, interesting projects, local events, ect. The Vancouver sun wrote an artical about Every Day Fiction where we talk about our newest upcoming project EveryDayNovels.com to be launched sometime in fall of 2010. [...]

What are mysql-bin.000001, mysql-bin.000002…

By default whenever you make a change to a MySQL database it creates a log of the query and stores it in a file simlare to ‘mysql-bin.000001′ . The MySQL database does this so that you can recover or replicate a database. Most applications this is a good things to have enabled just like doing regular backups. If you want to disable [...]

Looking for a new host

I been with a bunch of different hosts over the past few years Hostgator (Good)- Reseller account, only positive things to say about them so far. Good phone/Chat/Email support. Great response time for there servers. ect… Dreamhost (OKish) – 1800+ domains on shard hosting?! decent email support, lots of features, funny newsletter, downtime every month, [...]

The Best of Every Day Fiction Two (Anthology)

Flash fiction is perfect for your coffee break, your commute, or whenever you have a few minutes for yourself. Crafted with gemlike precision, every flash fiction piece tells a complete story, never using more than a thousand words. The Best of Every Day Fiction Two brings together one hundred flash fiction pieces selected from Every Day [...]

CakePHP – Security.level

I been having reports from my users that they are getting randomly logged out of my web applications. After much debugging I found that CakePHP regenerates the session on every request. File: core.php /** * The level of CakePHP security. The session timeout time defined * in ‘Session.timeout’ is multiplied according to the settings here. * Valid values: [...]

CakePHP – Disable validation in controler

When upgrading an old web application to start using CakePHP but the old systems was riddled with invalid data. When the creating the CRUD system I need a way of updating this invalid data. The following line of code will disable the validation in the controller. $this->Story->validate = array(); // Stop valadation on the story. Source: Cakephp Save [...]

CakePHP – Search bar

This code snippet will create a search box that uses can use to search for text in the database. The control creates a query to search certain fields of publsihed stories View or layout: <?php echo $form->create(‘Stories’, array(‘url’ => array(‘action’ => ‘index’))); echo $form->input(‘search_text’, array(‘label’ => false)); echo $form->end(‘Search’); ?> Controler: <?php function admin_index( ) [...]

Cakephp – Using the same view for multiple controler functions

Question: I have a Cakephp project the controller has several different methods. function Index() function IndexAuthor() And I want to use the same ‘view’ (or template, Index.ctp) for both of the methods of the control. Answer: You’re looking for Controller::render(). function IndexAuthor() { $this->autoRender = false ; $this->render(‘/stories/admin_index’); } Source: http://stackoverflow.com/questions/1753585/cakephp-same-view-for-multiple-functions

Insert new post in to wordpress from php

This code snippet should let you add a new post to your wordpress database 2.5.1 require_once(‘wp-config.php’); // create post object class wm_mypost {     var $post_title;     var $post_content;     var $post_status;    /* publish, private */     var $post_author;    /* author user id (optional) */     var $post_name;      /* slug (optional) */     var $post_type;      /* ’page’ or ’post’ (optional, defaults to ’post’) */     var $comment_status; /* open or closed for commenting (optional) */     var $post_category ;  } // initialize post object $wm_mypost = new wm_mypost(); $wm_mypost->post_title    = "Title2 ". date( ’r' ); $wm_mypost->post_content  = "content3"; $wm_mypost->post_status   = ’publish’;  $wm_mypost->post_author   = 1; // Catagorys $post_category = split("," , "one"); foreach($post_category as $key=>$val) {     $post_category[$key] = get_cat_ID($val); } $wm_mypost->post_category =  $post_category ;  // Optional; uncomment as needed // $wm_mypost->post_type = ’page’; // $wm_mypost->comment_status = ’closed’; // feed object to wp_insert_post $post_ID = wp_insert_post($wm_mypost); echo date( ’r' ) . "\n"; echo "post_ID:". $post_ID . "\n"; 

WHAT IS reCAPTCHA

A CAPTCHA is a program that can tell whether its user is a human or a computer. You’ve probably seen them — colorful images with distorted text at the bottom of Web registration forms. CAPTCHAs are used by many websites to prevent abuse from “bots,” or automated programs usually written to generate spam. No computer [...]

Open DNS

OpenDNS is a custom DNS server that you can use instead of using your IPS’s DNS server. It checks any address that you lookup against its own list of bad sites (phishing scams, and other things) and redirects you accordingly. It also provides a simple way of enabling/disabling blocking of adult websites. It often used [...]

Twitter vs Tumblr

Introduction There has been a lot of talk recently about the micro blogging. Micro blogging is a blogging platform that lets you post very small updates about your life, to help keep you and your friends up to date with each others lives. The services are kept very simple so anyone can use them easily. [...]