Tuesday, May 29, 2018
Sunday, May 20, 2018
Plunker
Plunker
Helping developers make the web
Plunker is an online community for creating, collaborating on and sharing your web development ideas.
http://plnkr.co/
JSHint
JSHint, A Static Code Analysis Tool for JavaScript
JSHint is a community-driven tool that detects errors and potential problems in JavaScript code. Since JSHint is so flexible, you can easily adjust it in the environment you expect your code to execute. JSHint is open source and will always stay this way.
Our goal
The project aims to help JavaScript developers write complex programs without worrying about typos and language gotchas.
Any code base eventually becomes huge at some point, so simple mistakes — that would not show themselves when written — can become show stoppers and add extra hours of debugging. So, static code analysis tools come into play and help developers spot such problems. JSHint scans a program written in JavaScript and reports about commonly made mistakes and potential bugs. The potential problem could be a syntax error, a bug due to an implicit type conversion, a leaking variable, or something else entirely.
Only 15% of all programs linted on jshint.com pass the JSHint checks. In all other cases, JSHint finds some red flags that could've been bugs or potential problems.
Please note, that while static code analysis tools can spot many different kind of mistakes, it can't detect if your program is correct, fast or has memory leaks. You should always combine tools like JSHint with unit and functional tests as well as with code reviews.
Reporting a bug
To report a bug simply create a new GitHub Issue and describe your problem or suggestion. We welcome all kinds of feedback regarding JSHint including but not limited to:
- When JSHint doesn't work as expected
- When JSHint complains about valid JavaScript code that works in all browsers
- When you simply want a new option or feature
Before reporting a bug, please look around to see if there are any open or closed tickets that discuss your issue, and remember the wisdom: pull request > bug report > tweet.
JSLint
What error drives our eyes and ears amiss?
—William Shakespeare, The Comedy of Errors
When C was a young programming language, there were several common programming
errors that were not caught by the primitive compilers, so an accessory program
called lint was developed that would scan a source file, looking for problems.
As C matured, the definition of the language was strengthened to eliminate some
insecurities, and compilers got better at issuing warnings. lint is no longer needed.
JavaScript is a young-for-its-age language. It was originally intended to do small tasks
in web pages, tasks for which Java was too heavy and clumsy. But JavaScript is a very
capable language, and it is now being used in larger projects. Many of the features that
were intended to make the language easy to use are troublesome for larger projects.
A
lint for JavaScript is needed: JSLint, a JavaScript syntax checker and verifier.
JSLint is a code quality tool for JavaScript. It takes a source text and scans it. If it
finds a problem, it returns a message describing the problem and an approximate
location within the source. The problem is not necessarily a syntax error, although it
often is. JSLint looks at some style conventions as well as structural problems. It
does not prove that your program is correct. It just provides another set of eyes to
help spot problems.
JSLint defines a professional subset of JavaScript, a stricter language than that
defined by the third edition of the ECMAScript Language Specification. The subset is
closely related to the style recommendations from Chapter 9.
JavaScript is a sloppy language, but inside it there is an elegant, better language.
JSLint helps you to program in that better language and to avoid most of the slop.
JSLint can be found at http://www.JSLint.com/.
A linter or lint refers to tools that analyze source code to flag programming errors, bugs, stylistic errors, and suspicious constructs. The term originates from a Unix utility that examined C language source code.
Number.isInteger
This is a new method coming in ES6, and it wasn’t previously available as a global function. The
isInteger
method returns true
if the provided value
is a finite number that doesn’t have a decimal part.console
.
log
(
Number
.
isInteger
(
Infinity
))
// <- false
console
.
log
(
Number
.
isInteger
(
-
Infinity
))
// <- false
console
.
log
(
Number
.
isInteger
(
NaN
))
// <- false
console
.
log
(
Number
.
isInteger
(
null
))
// <- false
console
.
log
(
Number
.
isInteger
(
0
))
// <- true
console
.
log
(
Number
.
isInteger
(
-
10
))
// <- true
console
.
log
(
Number
.
isInteger
(
10.3
))
// <- false
You might want to consider the following code snippet as a ponyfill for
Number.isInteger
. The modulus operator returns the remainder of dividing the same operands. If we divide by one, we’re effectively getting the decimal part. If that’s 0
, then it means the number is an integer.function
numberIsInteger
(
value
)
{
return
Number
.
isFinite
(
value
)
&&
value
%
1
===
0
}
Next up we’ll dive into floating-point arithmetic, which is well-documented as having interesting corner cases.
JavaScript - websites to use
Forking the Super-Calculator
Follow these steps to open the Super-Calculator and to make your own version of it:
Open your web browser and login at http://jsfiddle.net.
Go to our public dashboard at http://jsfiddle.net/user/forkids/fiddles and locate the program called Chapter 9 – Super-Calculator, or go directly to the Super-Calculator at http://jsfiddle.net/forkids/LdtbfnL0.
Click the Fork button in the top menu to make a copy of the Super-Calculator in your own JSFiddle account.
Use the Fiddle Options in the left menu to change the name of your Super-Calculator to (Your Name)’s Super-Calculator.
Click Update in the top menu, and then click Set as Base.
javascript - remainder -
Remainder (%)
The remainder operator returns the remainder left over when one operand is divided by a second operand. It always takes the sign of the dividend.
Syntax
Operator: var1 % var2
Examples
12 % 5 // 2
-1 % 2 // -1
1 % -2 // 1
NaN % 2 // NaN
1 % 2 // 1
2 % 3 // 2
-4 % 2 // -0
5.5 % 2 // 1.5
(function() {
"use strict";
var SomeText = function(text) {
this.text = text;
};
SomeText.prototype.capify = function(str) {
var firstLetter = str.charAt(0);
var remainder = str.substring(1);
return [firstLetter.toUpperCase(), remainder].join("");
};
SomeText.prototype.capifyWords = function() {
var result = [];
var textArray = this.text.split(" ");
for (var counter = 0; counter < textArray.length; counter++) {
result.push(this.capify(textArray[counter]));
}
return result.join(" ");
};
document.getElementById("main_button").addEventListener("click", function(e) {
var something = prompt("Give me something to capitalize");
var newText = new SomeText(something);
alert(newText.capifyWords());
});
}());
Wednesday, May 9, 2018
Tuesday, May 8, 2018
sqlmap -u
To scan a URL, we use the following command:
sqlmap -u "http://testphp.vulnweb.com/artists.php?artist=1"
Once a SQL has been detected, we can choose yes (Y) to skip other types of payloads:
Once SQL has been detected, we can list the database names using the --dbs flag:
We have the databases now; similarly, we can use flags such as --tables and --columns to get table names and column names:
To check whether the user is a database administrator, we can use the --is-dba flag:
The sqlmap command has a lot of flags. We can use the following table to see the different types of flags and what they do:
sqlmap -u "http://testphp.vulnweb.com/artists.php?artist=1"
Once a SQL has been detected, we can choose yes (Y) to skip other types of payloads:
Once SQL has been detected, we can list the database names using the --dbs flag:
We have the databases now; similarly, we can use flags such as --tables and --columns to get table names and column names:
To check whether the user is a database administrator, we can use the --is-dba flag:
The sqlmap command has a lot of flags. We can use the following table to see the different types of flags and what they do:
- The sqlmap command has a lot of flags. We can use the following table to see the different types of flags and what they do:
Flag
|
Operation
|
--tables
|
Dumps all table names
|
-T
| |
--os-cmd
|
Executes an operating system command
|
--os-shell
|
Prompts a command shell to the system
|
-r
| |
--dump-all
|
Dumps everything
|
--tamper
|
Uses a tamper script
|
--eta
| |
--dbs=MYSql,MSSQL,Oracle
| |
--proxy
|
Specifies a proxy
|
desktop-base mate-desktop-environment
How to do it...
To configure the Mate environment follow the given steps:
We start by using the following command to install the Mate environment:
apt-get install desktop-base mate-desktop-environment
The following screenshot shows the preceding command:
Type Y when it asks for confirmation on additional space requirements.
When installation is complete we will use the following command to set Mate as our default environment:
update-alternatives --config x-session-manager
Choose the option mate-session (in our case 2) and press the Enter key:
Log out and log in again or restart and we will see the Mate environment:
When Words are Wind
https://www.youtube.com/watch?v=Kcj4dj4lX84
- Netanel Goldberg ‖ Estas Tonne ‖ Joseph Pepe Danza ‖ Mitsch Kohn
Sunday, May 6, 2018
Williamsburg - 05/05/2018
Plato quotes (showing 1-30 of 1,012)
- “Be kind, for everyone you meet is fighting a harder battle.” ...
- “Every heart sings a song, incomplete, until another heart whispers back...
Memories from a city that feed my mind with good friends and memorable plateaus.
myArray.push and splice
// JavaScript Document
// Creating an array
var myArray = ["Doug", "Mike", "Janet", "Matt"];
console.log(myArray);
// Adding an item to the array
myArray.push("Pat");
console.log(myArray);
// Changing an item in the array
myArray[0] = "Tim";
console.log(myArray);
// Removing items from an array
myArray.splice(1,2);
console.log(myArray);
for loop - JavaScript - myArray.length
var myArray = ["Doug", "Laura", "Vera", "Gabriela"];
for (var i =0; i < myArray.length; i++)
{
console.log("Hello, " + myArray[i]);
//looping through an array with a for each loop
not so common and it doesn't provide a lot of granularity during the construction
for (var element of myArray)
{
console.log("Good bye, " + element);
}
for (var i =0; i < myArray.length; i++)
{
console.log("Hello, " + myArray[i]);
//looping through an array with a for each loop
not so common and it doesn't provide a lot of granularity during the construction
for (var element of myArray)
{
console.log("Good bye, " + element);
}
Thursday, May 3, 2018
Subscribe to:
Posts (Atom)
-
Curso Wireshark na UDEMY https://www.udemy.com/curso-profissional-sobre-wireshark/learn/v4/overview A filtragem em sinalizadores...