In software engineering, continuous integration (CI) is the practice of merging all developer working copies to a shared mainline several times a day. Grady Booch first proposed the term CI in his 1991 method, although he did not advocate integrating several times a day. Extreme programming (XP) adopted the concept of CI and did advocate integrating more than once per day – perhaps as many as tens of times per day.
Source
Microservices
A microservice is a software development technique—a variant of the service-oriented architecture (SOA) architectural style that structures an application as a collection of loosely coupled services. In a microservices architecture, services are fine-grained and the protocols are lightweight. The benefit of decomposing an application into different smaller services is that it improves modularity and makes the application easier to understand, develop, and test and more resilient to architecture erosion. It parallelizes development by enabling small autonomous teams to develop, deploy and scale their respective services independently. It also allows the architecture of an individual service to emerge through continuous refactoring. Microservices-based architectures enable continuous delivery and deployment.
Source
Moneda Argentina 1 peso con error provingias
En el año 1995 se encarga a la casa de la moneda de Inglaterra, la emisión de 56 millones de moneda de 1 peso,peroperoperopero al recibir las monedas en la República Argentina,se observa la inscripción “PROVINGIAS DEL RIO DE LA PLATA” Provincias con G.
jQuery.fn
jQuery.fn.extend() method extends the jQuery prototype ($.fn) object to provide new methods that can be chained to the jQuery() function.
Vanilla JS equivalents of jQuery methods
- https://gist.github.com/joyrexus/7307312
Sans jQuery
Events
1 | // jQuery |
1 | // jQuery |
Selectors
1 | // jQuery |
1 | // jQuery |
Attributes
1 | // jQuery |
Classes
1 | // jQuery |
1 | // jQuery |
Manipulation
1 | // jQuery |
1 | // jQuery |
1 | // jQuery |
Transversing
1 | // jQuery |
1 | // jQuery |
1 | // jQuery |
AJAX
GET
1 | // jQuery |
POST
1 | // jQuery |
JSONP
1 | // jQuery |
Get Json
1 | // jQuery |
Sync fork github
Add the remote, call it “upstream”:
git remote add upstream https://github.com/whoever/whatever.git
Fetch all the branches of that remote into remote-tracking branches, such as upstream/master:
git fetch upstream
Make sure that you’re on your master branch:
git checkout master
Rewrite your master branch so that any commits of yours that aren’t already in upstream/master are replayed on top of that other branch:
git rebase upstream/master
Equal sign javascript. == & ===
Strict equality using ===
Strict equality compares two values for equality. Neither value is implicitly converted to some other value before being compared. If the values have different types, the values are considered unequal. Otherwise, if the values have the same type and are not numbers, they’re considered equal if they have the same value. Finally, if both values are numbers, they’re considered equal if they’re both not NaN and are the same value, or if one is +0 and one is -0.
Strict equality is almost always the correct comparison operation to use. For all values except numbers, it uses the obvious semantics: a value is only equal to itself. For numbers it uses slightly different semantics to gloss over two different edge cases. The first is that floating point zero is either positively or negatively signed. This is useful in representing certain mathematical solutions, but as most situations don’t care about the difference between +0 and -0, strict equality treats them as the same value. The second is that floating point includes the concept of a not-a-number value, NaN, to represent the solution to certain ill-defined mathematical problems: negative infinity added to positive infinity, for example. Strict equality treats NaN as unequal to every other value – including itself. (The only case in which (x !== x) is true is when x is NaN.)
Loose equality using ==
Loose equality compares two values for equality, after converting both values to a common type. After conversions (one or both sides may undergo conversions), the final equality comparison is performed exactly as === performs it. Loose equality is symmetric: A == B always has identical semantics to B == A for any values of A and B (except for the order of applied conversions).
In the above table, ToNumber(A) attempts to convert its argument to a number before comparison. Its behavior is equivalent to +A (the unary + operator). ToPrimitive(A) attempts to convert its object argument to a primitive value, by attempting to invoke varying sequences of A.toString and A.valueOf methods on A.
Traditionally, and according to ECMAScript, all objects are loosely unequal to undefined and null. But most browsers permit a very narrow class of objects (specifically, the document.all object for any page), in some contexts, to act as if they emulate the value undefined. Loose equality is one such context: null == A and undefined == A evaluate to true if, and only if, A is an object that emulates undefined. In all other cases an object is never loosely equal to undefined or null.
Same-value equality
Same-value equality addresses a final use case: determining whether two values are functionally identical in all contexts. (This use case demonstrates an instance of the Liskov substitution principle.) One instance occurs when an attempt is made to mutate an immutable property:
Object.defineProperty will throw an exception when attempting to change an immutable property would actually change it, but it does nothing if no actual change is requested. If v is -0, no change has been requested, and no error will be thrown. But if v is +0, Number.NEGATIVE_ZERO would no longer have its immutable value. Internally, when an immutable property is redefined, the newly-specified value is compared against the current value using same-value equality.
Same-value equality is provided by the Object.is method.
Same-value-zero equality
Similar to same-value equality, but considered +0 and -0 equal.
Sameness Comparisons
x | y | == | === | Object.is | SameValueZero |
---|---|---|---|---|---|
undefined | undefined | true | true | true | true |
null | null | true | true | true | true |
true | true | true | true | true | true |
false | false | true | true | true | true |
‘foo’ | ‘foo’ | true | true | true | true |
0 | 0 | true | true | true | true |
+0 | -0 | true | true | false | true |
+0 | 0 | true | true | true | true |
-0 | 0 | true | true | false | true |
0 | false | true | false | false | false |
“” | false | true | false | false | false |
“” | 0 | true | false | false | false |
‘0’ | 0 | true | false | false | false |
‘17’ | 17 | true | false | false | false |
[1, 2] | ‘1,2’ | true | false | false | false |
new String(‘foo’) | ‘foo’ | true | false | false | false |
null | undefined | true | false | false | false |
null | false | false | false | false | false |
undefined | false | false | false | false | false |
{ foo: ‘bar’ } | { foo: ‘bar’ } | false | false | false | false |
new String(‘foo’) | new String(‘foo’) | false | false | false | false |
0 | null | false | false | false | false |
0 | NaN | false | false | false | false |
‘foo’ | NaN | false | false | false | false |
NaN | NaN | false | false | true | true |
javascript: null vs undefined differences
- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/null
- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined
null
The value null is written with a literal: null. null is not an identifier for a property of the global object, like undefined can be. Instead, null expresses a lack of identification, indicating that a variable points to no object. In APIs, null is often retrieved in a place where an object can be expected but no object is relevant.
undefined
undefined is a property of the global object; i.e., it is a variable in global scope. The initial value of undefined is the primitive value undefined.
In modern browsers (JavaScript 1.8.5 / Firefox 4+), undefined is a non-configurable, non-writable property per the ECMAScript 5 specification. Even when this is not the case, avoid overriding it.
A variable that has not been assigned a value is of type undefined. A method or statement also returns undefined if the variable that is being evaluated does not have an assigned value. A function returns undefined if a value was not returned.
1 | typeof null // "object" (not "null" for legacy reasons) |
Round number Javascript
OPTIONS requests
OPTIONS requests are what we call pre-flight requests in Cross-origin resource sharing (CORS).
They are necessary when you’re making requests across different origins in specific situations.
https://stackoverflow.com/questions/29954037/why-is-an-options-request-sent-and-can-i-disable-it?utm_medium=organic&utm_source=google_rich_qa&utm_campaign=google_rich_qa