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
#!/bin/bash | |
### Original script by Geoffeg, modified by Roblight and later by me (alias me='alias Danog='Daniil Gentili'') | |
### How to install this script: | |
### wget https://gist.github.com/danog/a3963463892f7f7df74a/raw/dropbox_youtube_dl.sh -O ~/dropbox_youtube_dl.sh && chmod 755 ~/dropbox_youtube_dl.sh && ~/dropbox_youtube_dl.sh --install | |
### | |
### IFTTT Recipe URL: https://ifttt.com/recipes/277403-download-every-youtube-video-you-add-to-your-watch-later-playlist-automatically | |
if [ "$1" = "--install" ]; then | |
if [ -f /usr/local/bin/youtube-dl ]; then echo "Youtube-dl already installed."; else echo "Installing youtube-dl..."; sudo curl https://yt-dl.org/downloads/2015.04.03/youtube-dl -o /usr/local/bin/youtube-dl && sudo chmod a+x /usr/local/bin/youtube-dl && echo "YouTube-dl installed successfully." || echo "Couldn't install YouTube-dl."; fi |
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; |
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
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
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
(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
$('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
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
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()) { |
NewerOlder