How I Check Spelling using Casperjs? - casperjs

I want to check content spelling for any give page (e.g: http://casperjs.org/) using Casperjs. is any method to that. How I do that help me?

You can check to one of this Spelling check library
https://github.com/cfinke/Typo.js
https://code.google.com/p/bjspell/
https://github.com/thinkphp/google-spell-check
Three of them in JS so you can add them to your code in CasperJs

Related

UglifyJS2 call minify function programmatically

I would like to know if I can call the minify main function programmatically.
I am able to run the same code as defined in compress, however replacing UglifyJS.Compressor with UglifyJS.minify does not work.
This is because I would like to pass the same options defined in the README of UglifyJS2, instead of the ones in compress.
Please note that I am running the code in Nashorn, and not in Node.js so that would be similar to a browser environment.
This is a work in progress: see this issue and this PR.

Can we add custom action to HtmlLoggerState

I'm using VS2013/CodedUI and my palybacksetting is as follow:
Playback.PlaybackSettings.LoggerOverrideState = HtmlLoggerState.AllActionSnapshot;
I also have a 3rd party tool that I have integrated to my code that does some action that codedui can't...Iw an to be able to log those steps into the ActionLog.html file with where codedui capture the actions and screenshot.
I searched a lot but didn't find anything on how we can achieve this.
thanks in advance for any help
I posted a response over here: Writing Custom HTML Logs
It sounds like there's not a good way to do this. You can get the path to where the html file lives and write a custom logger from there. I'm not sure it'd be safe to try and write to it while your test is executing, but perhaps once your test is complete.

how can i find the version of codeigniter an application was written in?

I'm reviewing someone's code and I can see that they're using codeigniter. But I'm trying to figure out which version they've used. I've been rooting around in the directory structure to find some information but haven't been successful yet.
Thanks.
Inside the framework, it's defined in 'CI_VERSION'.
Path is system/core/CodeIgniter.php
define('CI_VERSION', '2.1.3');
Simple as this;
echo CI_VERSION;
The constant is globally available and is pre-filled with the release version of the code you have.
Just put the echo in an empty controller and call it in the browser to test it.

How to trace CakePHP's inner workflow

Short description
I'm getting used to CakePHP right now and am wondering about how to get more debug-information about what is happening inside the framework.
Let me please explain my situation a little more detailed
As you know CakePHP does a lot for you without putting you into the need to write additional code. One example is the handling of models.
I just created a model User and added validation-rules (no other methods). As described in the API methods like save will just work.
After that I created the needed controller and view to add a new user. When I try to add a user from the view I just receive the flash-message The user could not be created. Please, try again. No validation-violations are flashed.
I also did set the debug-level to 2: Configure::write('debug', 2); but do not receive any errors. The error.log inside \tmp\logs is also empty.
I really do want to learn how to solve those issues in the future.
So what else can I do to debug / display inner processes of cake?
Thank you very much for your help!
DebugKit is an official plugin that gives you lots of information on the request, queries and variables produced by Cake:
https://github.com/cakephp/debug_kit
You can also use trace() and other methods in the Debugger to show what is being executed in the background:
http://book.cakephp.org/2.0/en/development/debugging.html
Use a PHP IDE with an integrated debugger. That will allow you to follow execution line by line as it is executed and even inspect variable values as you go. Netbeans is a free one.

Save file in magento after checkout completation

I need to save a file after a succesfully checkout. So I'm using the checkout_type_onepage_save_order_after event. When checking out, it stucks if I have some shitty code in there but it goes nicely if I have valid code in the observer. So it gets called, at least I think it does. Can't test it since it doesn't write my file, doesnt write anything in the log etc. So, what could be wrong? Why doesn't it write some stuff into the log? As I said, with other events it works perfectly. It's a new magento installation.
http://pastebin.com/TWyj6CYt cache is disabled. I'm using 1.5
I suggest you use the following event : sales_model_service_quote_submit_after
This event triggers right after the successful creation of an order.
You can also use Mage::log("Observer called"); just to check if your event observer is being invoked.
I hope this helps you :)
You have a class name Xxx_saveCheckout_Model_Observer. Class name parts usually all have uppercase initial letters, the autoloader expects that. Try changing it to Xxx_SaveCheckout_Model_Observer (with a capital 'S').
Also make sure the config file has a /config/global/models section, although it might be missing from your pastebin on purpose.

Resources