EzDevInfo.com

recess

A simple and attractive code quality tool for CSS built on top of LESS RECESS

.htaccess RewriteRule causing 403 Forbidden

I'm trying to install the Recess PHP framework on my web host (Dreamhost). It includes the following .htaccess:

Options FollowSymLinks
RewriteEngine On
RewriteRule ^([^.]+)$ $1.html [QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ bootstrap.php [QSA,L]

This works fine on my machine (XAMPP 1.7.7 on Windows 7) but results in 403 Forbidden errors on some files my web host. All directory permissions are set to 755 and all file permissions are set to 644. PHP runs under the same user that owns the files.

The following URLs result in 403s:

  • http://test.dd.moofz.com/
  • http://test.dd.moofz.com/recess-conf.php
  • http://test.dd.moofz.com/index.php
  • http://test.dd.moofz.com/bootstrap.php
  • http://test.dd.moofz.com/MIT-LICENSE

The following URLs don't:

  • http://test.dd.moofz.com/.gitignore
  • http://test.dd.moofz.com/httpd_logo_wide.gif
  • http://test.dd.moofz.com/README.textile
  • http://test.dd.moofz.com/the-book-of-recess.pdf

What would cause this to happen?


Source: (StackOverflow)

Recess framework stops me editing any files

I have installed Recess and created an app. However I cannot do anything with the files the app created, I can not edit, delete, move the files. When I try and delete i get a FTP error of 550. Any other files on the server I can modify any way I like.

I have found the user has been set to apache I can manually change this but why does it set this as the owner to start with?


Source: (StackOverflow)

Advertisements

Recess and Drupal Friend or Not?

I want to develop back-end of iphone app using recess for services layer component. This app will also have web app using same services layer component. I want to develop wep app using some CMS(Drupal) . I m confuse about databases . Since services layer will have its own database and drupal will have its own. But it is never a good idea to use two databases for same application. Kindly suggest alternatives. Thanks in advance


Source: (StackOverflow)

Bootstrap css fails grunt-recess lint task (noOverqualifying)

Twitter's Bootstrap is failing its own recess linting. When running grunt-recess on modals.less I get overqualifying errors.

The offending code (in LESS):

.modal {

  ...

  // When fading in the modal, animate it to slide down
  &.fade .modal-dialog {
    .translate3d(0, -25%, 0);
    .transition-transform(~"0.3s ease-out");
  }
  &.in .modal-dialog { .translate3d(0, 0, 0) }
}

and

.modal-backdrop {

  ...

  // Fade for backdrop
  &.fade { .opacity(0); }
  &.in { .opacity(@modal-backdrop-opacity); }
}

After compiling the LESS with grunt-contrib-less, I run recess to lint the resulting app.css.

The grunt-recess output:

Running "recess:dist" (recess) task
Warning: FILE: public/css/app.css
STATUS: Busted
FAILURES: 4 failures

Element selectors should not be overqualified
       1. .modal.fade .modal-dialog

Element selectors should not be overqualified
       1. .modal.in .modal-dialog

Element selectors should not be overqualified
       1. .modal-backdrop.fade

Element selectors should not be overqualified
       1. .modal-backdrop.in
 Use --force to continue.

I don't know that these selectors are overqualified, without the .modal and .modal-background classes these selectors would be under specified and it breaks the modal css.


Source: (StackOverflow)

sample of a backend for an iPhone app

I'm writing a backend for my iPhone app and I'm looking for tutorials or sample code for writing the backend.

I'm using RestKit as the client. so it would be using JSON and a RESTful framework.

Thanks.

My main problem is that I don't know how to translate the request from the iPhone to return the corresponding objects and how to translate those models to JSON in the backend.


Source: (StackOverflow)

How to compile 2 separate LESS files with grunt-recess

I want to compile 2 separate files with grunt recess:

recess: {
            dist: {
                options: {
                    compile: true
                },
                files: {
                    'path/css/custom.css': ['path/less/custom.less'],
                    'path/css/animate.css': ['path/less/antimate.less'],

                },
            },
        }, 

Only the first file is compiling before grunt exits. Where am I going wrong?


Source: (StackOverflow)

Grunt recess - how to check less

I want to check a less file for valid code. I used the grunt plugin "grunt-recess" and it works, but not as I want. This ist the part in Gruntfile.js:

recess: {
    dist: {
        src: [
            "less/base.less"
        ]
    }
}

If I write the following in my less file

.test {
    margin-left: 2px;
    margin-top: 2px


}

... it complains about the incorrect property order. But why it doesn't complain about the the missing ; and the blank lines? Maybe it's very easy, but not for me. It's the first time I'm using grunt and I'm not finding a solution (I used google a lot). I also tried "lesslint", but it didn't work either.

Thanks for your help!


Source: (StackOverflow)

How is user authentication done in a RESTful API?

I'm trying to develop a simple web service using Recess, which is a web framework aimed at being simple to use and being inherently RESTful. I've found it to be very easy to use the CRUD functionality in Recess. I've created a model with its backend in a MySQL database, and found that a REST API was already available for use.

That's great, but the problem is that I have no user authentication, which pretty much renders the really nice functionality I described above completely useless. In a real world application, authentication would be needed for accessing user-specific resources. For example, let's say I'm developing a simple "to-do" application (which I'm not, by the way). The user has no interest in what other people put in their to-do lists, so the service needs to identify who the user is, so as to provide the correct data. Also, the user should not be allowed to read, delete or update other peoples' resources.

This is done normally with a login system. But for a REST API, how is the user authenticated? Does the client need to provide the user's credentials (like a username and password) every time a request is made? How can that be avoided? Normally, one can use cookies, but this is probably not good practice, since not all clients are necessarily web browsers. But if we are to emulate the functionality of cookies, how do we transmit the "cookies'" contents (normally, this is done in the HTTP header)? And finally, how can I integrate a solution to these problems in Recess's built-in REST functionality?

As you can see, I'm fairly new to developing REST APIs, so any suggestions and pointers would be welcome.


Source: (StackOverflow)

Getting rid of index.php in the URL when using recess framework and lighttpd

I am using the recess php framework with lighttpd

Does anyone know how I can use the shorter urls of:

http://www.myserver.com/recess

Instead of:

http://www.myserver.com/index.php/recess

The recess readme file says that if I have mod_rewrite I can use the shorter url:

-- "Do you have mod_rewrite?

-- Yes: Open your browser to the location you unzipped

-- No: Open your browser to the location you unzipped followed by index.php"

I do have mod_rewrite enabled on lighttpd and i have removed the index.php but I get a 404.

Do I need any special rules in my lighttpd.conf?


Source: (StackOverflow)

Why is an error not produced when following the Recess 'Controlling the Controller' doc?

According to the section 'The Controller-View Relationship' located in http://www.recessframework.org/page/controlling-the-controller :

Try removing the body of the printIt method and refresh to get an error indicating no view template at 'helloWorld/views/printIt.php' can be found.

I tried this and upon refreshing the page, saw []. I checked the response header and it was of type application/json. Could this have something to do with it? I've tried installing Recess on another machine and it resulted in the same behavior.

Can someone tell me how to get an error???


Source: (StackOverflow)

Recess framework: Why am I getting a resource not found error when the file exists?

I'm thinking of using the Recess Framework which I downloaded as-is and followed the instructions studiously.

I'm using it with PHP (which is not the issue) and I seem to have it up and running... however I suspected something was slightly wrong with the pages being served (they did not contain the expected logos) so I inspected the code only to find out that the frameworks javascript and CSS files were "resource not found".

Incidentally the files exist at the path specified, and it's not a question that permissions are not set correctly - I checked that too.

But... I'm new to using "routing" through URLs as part of a MVC style and wondered if basically it has something to do with that.

If you download the framework, you'll find that the css and javascript files that make things look pretty, and activate certain parts of the framework toolset exists at the path:

http://localhost/yourRecessFolderName/index.php/recess/recess/apps/tools/public/js/shCore.js

but I get the dreaded 404 resource not found and this is preventing recess tools from working properly.

1) Has any body else had this or a similar problem? 2) What are the likely causes - help by pointing me in the right direction, unless you know the answer of course


Source: (StackOverflow)

Error installing Recess PHP framework

I downloaded the Recess PHP Framework source and untar in /var/www/html.

I did the modification as per readme in recess-conf.php.

{

    RecessConf::$defaultDatabase    
    = array( //'sqlite:' . $_ENV['dir.bootstrap'] . 'data/sqlite/default.db'    
            'mysql:host=localhost;dbname=testdb', 'root', 'root'    
        );    

}

I am getting the error when I open the google-chrome and type localhost

PDO has not been imported.

Location: Line 19 of /var/www/html/recess/recess/database/pdo/PdoDataSource.class.php

followed by call stack.

Please let me know how to resolve the issue.

Regards Sachin


Source: (StackOverflow)

JSON view in Recess Framework

I am trying to create an api with Recess and I have a question about its JsonView. Currently, if I do a GET request on, for example, /users/1 (which routes to a function that gets all the details for the user with id 1 and responds with Json), I get the following:

{"users":{"id":"1","username":null,"password":null,"datejoined":false}}

How can I make it so that I get the following instead:

{"id":"1","username":null,"password":null,"datejoined":false}

That is, I don't want all the details wrapped inside "users":{}.


Source: (StackOverflow)

How to add authentication to RECESS?

I have a RECESS based project. I want to add password protection to the views where I add/edit/delete my new model objects, they should only be accessed after passing through a password entry view and if someone tries to access directly the said views should again get redirects to the login page. Any help with that?


Source: (StackOverflow)

RECESS change properties' order

I use node.js, grunt and RECESS to compile my *.less files into *.css files.
It's my Gruntfile.js file

 module.exports = function(grunt) {

grunt.initConfig({
    pkg: grunt.file.readJSON('package.json'),

    recess: {
        dist: {
            options: {
                compile: true
            },
            files: {
                'css/style.css': 'less/style.less'
            }
        }
    },
    watch: {
        recess: {
            files: ['less/*.less'],
            tasks: ['recess'],
            options: {
                spawn: false,
            },
        }
    }
});

grunt.loadNpmTasks('grunt-recess');
grunt.loadNpmTasks('grunt-contrib-watch');

grunt.registerTask('default', ['recess', 'watch']);

};

but now I need to change properties' order in output *.css file like

.class {
  margin: 0;
  padding: 0;

  width: auto;
  min-width: 0;
  max-width: 0;
  height: auto;
  min-height: 0;
  max-height: 0;

  display: block;
  visibility: hidden;
  overflow: hidden;
  float: none;

  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;

  text-align: left;
  text-decoration: none;
  text-indent: 1;
  text-transform: uppercase;
  letter-spacing: 1;
  vertical-align: top;
  line-height: 1;
  white-space: normal;
  word-spacing: normal;

  font: 1em sans-serif;
  font-family: Arial, sans-serif;
  font-size: 1em;
  font-weight: normal;
  font-style: normal;
  font-variant: normal;

  opacity: 1;
  color: red;
  border: 1px solid red;
  background: #fff url(../i/bg.png) no-repeat 0 0;  

  z-index: 0
  cursor: default;

}

I've found out strict-property-order.js https://github.com/twitter/recess/blob/master/lib/lint/strict-property-order.js#L36 and I guess it can help me, but I don't know how to use it?


Source: (StackOverflow)