<script>
x = '<!--<script>'/*</script>-->*/;alert(1)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let binarySearch = function (array, valueSearch) { | |
let start = 0; | |
let end = array.length - 1; | |
return function search(start, end) { | |
let mid = Math.round((start + end) / 2); | |
let length = end - start; | |
if (length < 0) return -1; |
A list of topics to study before implementing a large and scalable React + Redux application.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Handling Errors using async/await | |
* Has to be used inside an async function | |
*/ | |
try { | |
const response = await axios.get('https://your.site/api/v1/bla/ble/bli'); | |
// Success 🎉 | |
console.log(response); | |
} catch (error) { | |
// Error 😨 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* ----------------------------------------- * | |
Lazy List Implementation | |
* ----------------------------------------- */ | |
// Haskell-like infinite List, implemented with es6 generators | |
// Lazyness lets you do crazy stuff like | |
List.range(0, Infinity) | |
.drop(1000) | |
.map(n => -n) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
/*****************NATIVE forEACH*********************/ | |
Array.prototype.myEach = function(callback) { | |
for (var i = 0; i < this.length; i++) | |
callback(this[i], i, this); | |
}; | |
//tests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git branch -m old_branch new_branch # Rename branch locally | |
git push origin :old_branch # Delete the old branch | |
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote |
This is how you connect PS3 controller to Mac OSX, PC, etc. when previously connected to a PS3. You will need a Mini USB cable. Overcome your laziness, get up of your chair, and go get one!
A big misconception is that keep holding PS button will reset the controller's pairing. It DOES NOT! From my testings, the controller keeps paring with the last machine it was CONNECTED VIA A USB CABLE.
Here are the steps:
##Tirando uma foto na hora do commit com Mercurial!
Instale o imagesnap
brew install imagesnap
No arquivo ~/.hgrc
NewerOlder