Richard Castera - Explorations in Software Development
Richard Castera - Explorations in Software Development
Browsing Category
Scripts

Get your Twitter follower count with jQuery

October 13, 2011 No Comments
JavaScript
1
2
3
4
5
6
7
8
9
10
11
12
13
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.4.3/jquery.min.js"></script>
<script>
$(function(){
    $.ajax({
        url: 'http://api.twitter.com/1/users/show.json',
        data: {screen_name: 'rcastera'},
        dataType: 'jsonp',
        success: function(data) {
            console.log(data.followers_count);
        }
    });
});
</script>
Continue reading
Reading time: 1 min
Share:
Written by: rcastera
Scripts

A PHP function for the Fibonacci sequence

October 11, 2011 No Comments

I was recently asked as a test to write a function that outputs the Fibonacci sequence in PHP. Here it is:

PHP
1
2
3
4
5
6
7
8
9
10
11
12
function fib() {
    $current = 1;
    $previous = 0;
    $evaluation = 0;
    while($evaluation < 100) {
        $evaluation = ($current+$previous);
        $current = $previous;
        $previous = $evaluation;
        echo $evaluation . '<br>';
    }
}
Continue reading
Reading time: 1 min
Share:
Written by: rcastera
Thoughts

No one wants to die

October 4, 2011 No Comments
No one wants to die. Even people who want to go to heaven don’t want to die to get there. And yet death is the destination we all share. No one has ever escaped it. And that is as it should be, because Death is very likely the single best invention of Life. It is Life’s change agent. It clears out the old to make way for the new. Right now the new is you, but someday not too long from now, you will gradually become the old and be cleared away. Sorry to be so dramatic, but it is quite true.
Your time is limited, so don’t waste it living someone else’s life. Don’t be trapped by dogma — which is living with the results of other people’s thinking. Don’t let the noise of others’ opinions drown out your own inner voice. And most important, have the courage to follow your heart and intuition. They somehow already know what you truly want to become. Everything else is secondary.

-Steve Jobs

Continue reading
Reading time: 1 min
Share:
Written by: rcastera
Scripts Web Server

Getting MySQL and PHP running on Terminal with XAMPP

September 20, 2011 No Comments

I have XAMPP setup on my Mac. Getting MySQL and PHP to run in terminal didn’t work after installation. To be able to run mysql and php you have to add the xampp application to the .bash_profile file in your users home directory.

1
2
3
4
5
6
7
8
9
10
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
export XAMPP_HOME=/Applications/xampp/xamppfiles
export PATH=${XAMPP_HOME}/bin:${PATH}
export PATH
unset USERNAME

To check that it has worked, open a new terminal session and type in:

1
2
which mysql
which php

Both should point to /Applications/xampp/xamppfiles

Continue reading
Reading time: 1 min
Share:
Written by: rcastera
Scripts Web Server

Recursively remove .svn folders on Windows

September 14, 2011 No Comments

I’m not an SVN guy; I love my GIT but, sometimes you inherit projects where SVN was the choice used for version control. There are many ways to do this of course but my preferred method is creating a Batch (.bat) file in the root of the target folder, add this line and run it.

1
FOR /F "tokens=*" %%G IN ('DIR /B /AD /S *.svn*') DO RMDIR /S /Q "%%G"
Continue reading
Reading time: 1 min
Share:
Written by: rcastera
Thoughts

People that think they can change the world, actually do

August 31, 2011 No Comments

People that think they can change the world, actually do!

Continue reading
Reading time: 1 min
Share:
Written by: rcastera
Thoughts

Why do some startups fail?

May 25, 2011 No Comments

There are many variables that are instrumental to the failure of a startup. Having a failed startup myself, I studied and analyzed my thoughts and actions during this period to see what I did wrong; and what I could have done to improve the process of beginning and maintaining my startup. I wish I would have been more knowledgeable or had a mentor to coach me through some of the surprises and feelings I encountered but, sometimes the process of learning is a lonely and difficult one, and one that you’ll never forget. So, I would like to share some of the insights that I’ve gathered from my journey and hopefully, you won’t make the same mistakes I made.

My first mistake

my-first-mistake

I was 22 years old and not thinking large in terms of starting a full scale business. I always knew I wanted to be an entrepreneur, but lacked the knowledge of starting, running or even owning a business. One thing was certain though, I wanted to be a free man. We all want that freedom; freedom of money to buy what we want, freedom of time to go to the gym, spend more time with our families, kids, friends, travel, etc. Although all achievable, freedom doesn’t come easy; it’s something that you have to work hard to attain.

Continue reading
Reading time: 9 min
Share:
Written by: rcastera
Resources Scripts Web Server

Drupal – How to install Drush

August 27, 2010 3 Comments

What is Drush?

It’s a command line shell and scripting interface for Drupal. The Drush Package Manager allows you to download, enable, disable, uninstall, update modules/themes/profiles/translations from the command line in a very simple way (apt-get style) – just type,

1
drush dl views

and

1
drush pm-enable views

in a Drupal directory to install the Views project! Additionally, the Drush Package Manager also allows you to update all your modules and even Drupal core with just one command,

Continue reading
Reading time: 1 min
Share:
Written by: rcastera
Resources

5 ways to test the Usability of your E-commerce Site

August 20, 2010 9 Comments

Usability testing is a technique used to evaluate a product, service or website by testing it on users and it’s good practice to perform tests in combination with Split testing. Having an e-commerce site myself, I had to pay special attention to the elements on pages and where my products are positioned in relation to the page. There are so many variables involved in optimizing the usability of page such as dimensions, colors, copy, etc. If users cannot find your product, then they cannot buy it either.

There are many methods for studying usability, but the most basic and useful is done through user testing. Here are some tools to help you in studying if your missing out on sales, and what you can do to improve conversions.

Continue reading
Reading time: 2 min
Share:
Written by: rcastera
Scripts Web Server

Magento – Add Static Block to CMS Page

July 29, 2010 5 Comments

Static blocks are a great way to add sections of HTML to your CMS or Catalog pages. I’m going to show you how to add a static block to a CMS page.

It’s a 2 step process and a very simple one. First, create your static block by going to CMS->Static Blocks. You will use the identifier of your static block to reference it on the CMS page. Edit the CMS page you would like this block to appear in, and add this code in the location where you would like it to show up:

1
{{block type="cms/block" block_id="home-page-promo"}}
Continue reading
Reading time: 1 min
Share:
Written by: rcastera
Page 2 of 11«1234»10...Last »

About me

Hello, my name is Richard Castera. I have more than 12 years of experience architecting, implementing, leading and launching large scale, high performance software products in a fast-paced agile environment.

Popular Posts

Magento – Display new products on the home page

May 20, 2009

How to Fix “Internet Explorer Cannot Open the Internet Site- Operation Aborted” Error

May 9, 2009

PHP – Convert Array to Object with stdClass

July 5, 2009

Categories

  • Home Automation
  • Resources
  • Scripts
  • SEO
  • Thoughts
  • Web Server

Tags

Apache Apple Bash CSS Drupal Free home automation htaccess Java Javascript Magento PHP raspberry pi SEO SQL thoughts Wordpress

© 2019 copyright Richard Castera // All rights reserved