This text is replaced by the Flash movie.

Heroku Refinery

March 26th, 2013
Was having hard time running refinery dashboard on heroku.

I posted Logs/Errors/How I fixed - on Gist

Made the dashboard run finally on heroku

Discourse – Project

March 10th, 2013
Excited with our new project with rails using discourse, locally it run without problem using vagrant. Hope it will be successful with heroku and redis.

Vagrant running discourse. Discourse local test

Discourse on github

Form Sencha Touch 2.0

August 3rd, 2012
If you are planning to create a simple email form for your mobile site you might find this app helpful and add it to your own application. Assisted by Sencha Architect 2, this form panel uses model to validate the form fields and send data to server side script in my case using PHP.

Setup with Sencha Architect. Sencha Architect Setup

Code for submitting the fields
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
onSubmitContactTap: function(button, e, options) {
        var values = this.getValues();
        var contactData = Ext.create('MyApp.model.ContactForm', {
            fullname: values.fullname,
            email: values.email,
            phone: values.phone,
            inquiry: values.inquiry  
        }),
        errs = contactData.validate(),
        msg = '';
 
        if (!errs.isValid()) {
            errs.each(function (err) {
                msg += Ext.String.capitalize(err.getField()) + " " + err.getMessage() + '<br/>';
            });
            Ext.Msg.alert('ERROR', msg);
        } else {
            Ext.Ajax.request({
                url: 'inquiry.php',
                params: {
                    fullname: values.fullname,
                    gender: values.gender,
                    email: values.email,
                    phone: values.phone,
                    inquiry: values.inquiry 
                },
                method: 'POST',
                success: this.handleSuccess,
                failure: this.handleError
            });
 
        } // if

Testing with Chrome.
Sencha Debug

PHP Code
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<?php
  //The Posts
  $fullname = make_safe($_POST['fullname']);
  $email = make_safe($_POST['email']);
  $gender = make_safe($_POST['gender']);
  $phone = make_safe($_POST['phone']);
  $inquiry = make_safe($_POST['inquiry']);
 
  //Simple escape string for mysql insertion
  function make_safe($variable) {
	$variable= strip_tags($variable); 
	$variable = mysql_real_escape_string(trim($variable));
        return $variable;				
  }
 
echo json_encode(array('fullname' => $fullname,
						'email'   => $email,
						'gender'  => $gender,
						'phone'   => $phone,
						'inquiry' => $inquiry));


Download the code (Sencha Architect 2.0)

Annotate Ruby on Rails

February 11th, 2012
I want to try this annotate on rails which put lists of datafield to your build model, I'm trying this with windows 7, and produced a lot of bugs, number 1 error - the "annotate" gem, without version number I installed didn't work well, I learned that installing gem annotate need to have version number for the Ruby/Rails version I have, annotate 2.4.1.beta worked fine. Next after I run bundle install for the new gem needed and run annotate on command console, it popout an error

'const_missing': uninitialized constant Rake::DSL (NameError)


Error Annotate

After searching the net for solutions I found out that the new command for this annotate version with my current version of gems and ruby is just to run "bundle install annotate", and I checked the model and annotation worked.
Annotate Worked

Version I'm Running
-Ruby 1.9.2
-Gem Annotate 2.4.1.beta
-Rail 3.1.0
-Rake 0.9.2.2


Final Gemfile Setup for Development
1
2
3
4
5
6
7
8
group :development do
   # gem 'annotate_models' -> this is fucking gonner
   # gem 'annotate' -> don't work
   # run in command bundle exec annotate
   gem 'annotate', '~> 2.4.1.beta' #for the error occuring a beta patch
   gem 'webrat' #important with rspec -> Rspec - undefined method `has_selector?' 
   gem 'rspec-rails'
end

Two Versions Cake Console

January 13th, 2012
Cake 2.0 was recently release, but I don't want to migrate yet some applications I already build with this version (afraid there are so many changes) most of my work are under 1.3, so I just decided to study it first. To have 2 cake console what I did is just to add another path in environment variables, Cake 2.0 console path is at cakephp/app/console and just rename cake.bat to cake2.bat, now I can use 2 cake versions within my current PC system. 

Cake Console 2.0