Create Volume using AWS and attach it to instance
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 myDiv = $('.stage'); | |
let myImage = $('.stage img'); | |
let stage = { | |
width: myDiv.width(), | |
height: myDiv.height(), | |
} | |
let item = { | |
width: myImage.width(), |
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
// We are creating a new style tag | |
let newStyleSheet = document.createElement("style"); | |
// Appending the style tag to the head. | |
document.head.appendChild(newStyleSheet); | |
// Writing to the style sheet some css rules including keyframes and the animation class | |
newStyleSheet.appendChild(document.createTextNode(` | |
@keyframes my-fun-keyframes { | |
/* My keyframes for the animation I want to create */ |
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 inlineJs = `function(){ console.log("Some JS Code!") }`; | |
let workerBlob = window.URL.createObjectURL(new Blob([inlineJs])); | |
let worker = new Worker(workerBlob); | |
/** | |
* XHR with worker | |
*/ | |
let worker; // Keep this in the global scope | |
var request = new XMLHttpRequest(); |
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
const players = {itamar: 1200, eddie: 1210, eli: 1183, uriel: 1201}; | |
const newPlayers = []; | |
for (var player in players) { | |
if (players.hasOwnProperty(player)) { | |
newPlayers.push({ | |
player, | |
rank: players[player], | |
}); | |
} | |
} |
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
const players = {itamar: 1200, eddie: 1210, eli: 1183, uriel: 1201}; | |
const sortedPlayers = | |
Object.keys(players) // Convert all object keys to an array | |
.map(p => ({name: p, rank: players[p]})) // Map to wanted object | |
.sort(function(a, b) { // Sort! | |
return b.rank - a.rank; | |
}); | |
console.log(sortedPlayers); // Done! |
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
const players = {itamar: 1200, eddie: 1210, eli: 1183, uriel: 1201}; | |
const newPlayers = _.map(players, (v, k) => ({name: k, rank: v})); | |
const sortedPlayers = _.orderBy(newPlayers, ['rank'], ['desc']) | |
console.log(sortedPlayers); // Done! |
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
const players = {itamar: 1200, eddie: 1210, eli: 1183, uriel: 1201}; | |
const sortedPlayers = _.orderBy(_.map(players, (v, k) => ({name: k, rank: v})), ['rank'], ['desc']); | |
console.log(sortedPlayers); |
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
const res = _({itamar: 1200, eddie: 1210, eli: 1183, uriel: 1201}) | |
.map((v, k) => ({name: k, rank: v})) | |
.orderBy(['rank'], ['desc']); | |
console.log(res); // Not working. |
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
const res = _({itamar: 1200, eddie: 1210, eli: 1183, uriel: 1201}) | |
.map((v, k) => ({name: k, rank: v})) | |
.orderBy(['rank'], ['desc']) | |
.value(); | |
console.log(res); // Done! |
OlderNewer