Dedicated Developers and Engineers, with a Track Record.
by csreladm via CSSREEL | CSS Website Awards | World best websites | website design awards | CSS Gallery
"Mr Branding" is a blog based on RSS for everything related to website branding and website design, it collects its posts from many sites in order to facilitate the updating to the latest technology.
To suggest any source, please contact me: Taha.baba@consultant.com
Dedicated Developers and Engineers, with a Track Record.
inmenu is the leading for restaurants customized system of Online Food Ordering and Mobile Food Ordering system in USA. Increase your revenue by offering food ordering system to customers.
Institutional & Corporate Events Agency
line-height
In this quick tip, we'll look at a shorthand for setting font-size and line-height together to save yourself a couple of extra keystrokes.
line-height
, as discussed in the original screencast video, is a property for setting the height of a line in CSS. It's similar (but slightly different) to leading in print design.
line-height
only applies to elements that have their display
set to inline
or inline-block
and it actually sets the height of the line box that bounds the element. If you set line-height
on a block element, you may still see some changes to your styles but it's actually the inline
child elements that are being affected as line-height
is an inherited property.
Continue reading %AtoZ CSS Quick Tip: Setting the Line-Height%
I feel that debugging is as crucial a part of the development cycle as any other. So it's always good practice to demystify the job of debugging, making it easier and less time-consuming, so that we can end work on time and reduce stress.
Like the majority of languages out there, Node provides some excellent debugging tools which make defects in code easily found and fixed. I always advocate the usage of a debugger because personally I find using debuggers really eliminates the need for any guesswork and makes us better developers in general.
This guide is for developers and administrators that work with Node already. It presumes a fundamental understanding of the language at a practical level.
Node.js includes a full-featured out-of-process debugging utility accessible via a simple TCP-based protocol and built-in debugging client.
For example, to use the debugger to debug a file named script.js
, you can simply call node using the debug
flag as so:
$ node debug script.js < debugger listening on port 5858 connecting... ok debug>
Now that you have started a debugging session, anywhere in your script that you call debugger
from will be a breakpoint for the debugger.
So, for example, let's add a debugger statement to the script.js:
foo = 2; setTimeout(() => { debugger; console.log('bugger'); }, 1000); console.log('de');
Now if we run this script the debugger will be called on our breakpoint and we can control the script control via using the cont
or next
commands (c
or n
for short).
We can pause the script execution at any time by using p
.
$ node debug script.js < debugger listening on port 5858 connecting... ok break in /home/tom/web/envatodebug/myscript.js:1 1 foo = 5; 2 setTimeout(() => { 3 debugger; debug> cont < de break in /home/tom/web/envatodebug/myscript.js:3 1 foo = 5; 2 setTimeout(() => { 3 debugger; 4 console.log('bugger'); 5 }, 1000); debug> next break in /home/tom/web/envatodebug/myscript.js:4 2 setTimeout(() => { 3 debugger; 4 console.log('bugger'); 5 }, 1000); 6 console.log('de'); debug> next < bugger break in /home/tom/web/envatodebug/myscript.js:5 3 debugger; 4 console.log('bugger'); 5 }, 1000); 6 console.log('de'); 7 debug> quit
$ node debug script.js < debugger listening on port 5858 connecting... ok debug> repl Press Ctrl + C to leave debug repl > foo 2 > 2+2 4
The Read-Eval-Print-Loop of the debugger allows you to enter code interactively during execution and thus access the state of the application and all of its variables and methods at the point of breaking execution. This is a very powerful tool which you can use to quickly sanitize your app.
In general, the REPL is available as a standalone and as part of the debugger, and it allows you to run JavaScript interactively. For example, just type node
at the prompt with no options, and you will be given a REPL interface that you can write code into and see the output.
Earlier I mentioned the cont
and next
(c
and n
) commands, which allow us to continue code execution once a breakpoint has been reached. In addition to this, as we walk through the code we can also step in to a method or step out to its parent scope.
Use the commands step
to step in and out
to step out, or s
and o
for short.
Use backtrace
or bt
to get an output of the backtrace for the current execution frame.
Use restart
or r
to restart your script from the beginning of execution.
Advanced users can access the debugger also by starting Node.js with the --debug
command-line flag, or alternatively by signaling an existing Node.js process with SIGUSR1
.
Once a process has been set into the debug mode this way, it can then be connected to by using the Node.js debugger by either using the pid
of the running process or via a URI reference (e.g localhost:port
) to connect the listening debugger:
node debug -p <pid>
connects to the process via the pid
.node debug <URI>
connects to the process via the URI such as localhost:5858
.In addition to the CLI debug tool, Node Inspector also provides a GUI inspector inside the web browser (currently only supporting Chrome and Opera).
To use the debugger, simply install as so:
npm install -g node-inspector
Now that we have the Node inspector installed, we can debug our script.js with:
node-debug script.js
Your shell will now output the following, and probably open the web browser to the URL if you have Chrome or Opera set as your default on your development OS.
Node Inspector is now available from http://ift.tt/1UiJ3iG Debugging `script.js` Debugger listening on port 5858
In your web browser, you will now be able to debug your application in a similar environment to the developer tools package. Setting breakpoints and viewing code is now integrated with your browser view. Enjoy!
Debugging doesn't need to be a nightmare, nor does it need to be stressful.
Setting breakpoints and stepping through code is so simple in Node. It's a very similar experience to Ruby, and if you are trying to understand an application you have been given, opening the app in debug mode and pausing execution is a fantastic way to learn in a rapid timeframe.
Do you want to improve the search rank for your website or blog? Wondering how social media can help? Social media and search engine optimization (SEO) are undoubtedly connected and will only become more interdependent in the future. In this article, you’ll discover seven ways you can use social media to boost your search rankings. [...]
This post 7 Ways to Improve Your Search Rank With Social Media first appeared on .
- Your Guide to the Social Media Jungle