Thursday, August 21, 2014

Goddady wildcard subdomain url call handling

If I type in the browser www.jhonjairoroa87.com, the blog is shown. But when I type test.jhonjairoroa87.com, there was no page loaded. So iI wabnted to enable the routing from anysubdomain.jhonjairoroa.com to this blog.

So, the solution was:

Go to GoDaddy's DNS Manager, the first table on top should say A(Host), click the button under that first table that says Quick Add. In the first text field, enter an asterisk (*), in the second one, the IP address to redirect to (the same one you have for the @ record on top). Click "Save Zone File" on top-right and confirm.

This creates a catch-all record to anysub.yourdomain.com.

Reference: 

Friday, August 1, 2014

RequireJS: Uncaught Error: Module name "underscore" has not been loaded yet for context: _. Use require([])

I was getting the error

Uncaught Error: Module name "underscore" has not been loaded yet for context: _. Use require([])

Solved it adding the shim values in the require js config:

require.config({
    paths:{
        jquery:'jquery/jquery-min',
        underscore:'underscore/underscore-min',
        backbone:'backbone/backbone-min'
    }, 
    // here
    shim: {
        underscore: {
            exports: '_'
        },
        backbone: {
            deps: ["underscore", "jquery"],
            exports: "Backbone"
        },
        waitSeconds: 15
    }
});

Source: http://stackoverflow.com/questions/16774214/trouble-combining-require-js-and-backbone-js-underscore-js

Tuesday, July 15, 2014

.Net ReportViewer datetime format problem am/pm

I was having troubles formating a datetime parameter with am/pm. No matter the formatting, it was always missing the am/pm .

 - The expression was Parameters!initDate.Value and I got 2014/01/07 12:00:00
I also tried
 -Format(Parameters!initDate.Value,"yyyy/MM/dd hh:mm:ss tt") and I got 2014/01/07 12:00:00

and so on....

So I decided to use an if to evaluate the hour and manually set the am/pm:

=Format(Parameters!initDate.Value,"yyyy/MM/dd hh:mm:ss ") + IIf(Parameters!initDate.Value.Hour > 11, "pm", "am")

Tuesday, June 10, 2014

Python: install pip and Flask on windows 8

Install pip:

> python get-pip.py

Install Flask:

> python -m pip install Flask

Resource:
http://pip.readthedocs.org/en/latest/installing.html


Wednesday, May 28, 2014

PHP: NotORM tutorial

fatfree: error routing about in tutorial

following this tutorial : http://fatfreeframework.com/routing-engine, after adding

$f3->route('GET /about','WebPage->display');

the url localhost/myproject/ works fine, but localhost/myproject/about doesnt work.

To solve the problem, follow these steps:

1. create a file name .htaccess with the following content:

# Enable rewrite engine and route requests to framework
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-l
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php [L,QSA]

# Disable ETags
<IfModule mod_headers.c>
Header Unset ETag
FileETag none
</IfModule>

# Default expires header if none specified (stay in browser cache for 7 days)
<IfModule mod_expires.c>
ExpiresActive On
ExpiresDefault A604800
</IfModule>

2. put the .htaccess file in the root of wour project, ie {apacheserverdir}\htdocs\pyproject\.htaccess

The error happens because is missing the .htaccess file in the right place:

\htdocs\myproject
\htdocs\myproject\.htaccess -- add htaccess file here
\htdocs\myproject\index.php
\htdocs\myproject\libs
\htdocs\myproject\libs\fatfree-master
......
\htdocs\myproject\libs\fatfree-master\.htaccess -- here is a htaccess file that is not used at all
......
\htdocs\myproject\libs\fatfree-master\lib
\htdocs\myproject\libs\fatfree-master\lib\audit.php
\htdocs\myproject\libs\fatfree-master\lib\auth.php
\htdocs\myproject\libs\fatfree-master\lib\base.php
......
......
.....

Resource:
https://github.com/bcosca/fatfree/blob/archive/f3-2.1.0-blog.example.zip

Tuesday, May 27, 2014