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 Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
var cursor = db.VirtualMachine.find().limit(10);// | |
var map = function() { | |
emit(this._id, this.Name); | |
}; | |
var emit = function(key, value) { | |
print("id: " + key + " Name: " + tojson(value)); | |
}; | |
while (cursor.hasNext()) { |
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
var post = function post(path, params, method) { | |
method = method || "post"; // Set method to post by default if not specified. | |
// The rest of this code assumes you are not using a library. | |
// It can be made less wordy if you use one. | |
var form = document.createElement("form"); | |
form.setAttribute("method", method); | |
form.setAttribute("action", path); | |
for (var key in params) { |
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
$('input[type=checkbox]').each(function(checkbox){ | |
$(checkbox).prop('checked', true); | |
}); |
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
(function(console){ | |
console.save = function(data, filename){ | |
if(!data) { | |
console.error('Console.save: No data') | |
return; | |
} | |
if(!filename) filename = 'console.json' |
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 r; | |
const runTasks = (...tasks) => Promise.all(tasks.map(t => { | |
"use strict"; | |
debugger; | |
})).then((r)=> { | |
console.log(r); | |
return r; | |
}) | |
const tA = () => new Promise(r => setTimeout(()=> r('A'), 1000)) |
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 r; | |
const runTasks = (...tasks) => Promise.all(tasks.map(t => t())).then(r => (r)); | |
const tA = () => new Promise(r => setTimeout(() => r('A'), 1000)); | |
const tB = () => new Promise(r => setTimeout(() => r('B'), 100)); | |
const tC = () => new Promise(r => setTimeout(() => r('C'), 100)); | |
runTasks(tA, tB, tC).then(re => { | |
console.log(re); | |
}); |
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
import React, { Component } from 'react'; | |
class WidgetApp extends Component { | |
constructor(props) { | |
super(props); | |
this.state = { isOpen: false }; | |
} | |
toggleModal = () => { |
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
.circle--arrow { | |
display: inline-block; | |
width: 30px; | |
height: 30px; | |
background-color: transparent; | |
background-image: svg-load('icons/arrow--thin--left.svg'); | |
background-repeat: no-repeat; | |
background-position: center center; | |
background-size: initial; | |
border: solid 2px $blue-dark; |
OlderNewer