This file contains hidden or 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 durationContainers = Array.from(document.querySelectorAll("#primary #contents .ytd-thumbnail-overlay-time-status-renderer")); | |
| var durations = durationContainers.map(__span => __span.innerText).map(duration => { | |
| if (duration) { | |
| const fragments = duration.split(":").reverse(); | |
| const fragmentsToSeconds = fragments.reduce((acc, current, idx) => acc + parseInt(current) * Math.pow(60, idx), 0); | |
| return fragmentsToSeconds | |
| } | |
| else { | |
| return 0; | |
| } |
This file contains hidden or 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
| #include <stdio.h> | |
| #include <gmp.h> | |
| void countDigits(mpz_t sourceNumber, mpz_t result) { | |
| mpz_t digitCount; | |
| mpz_init_set_ui(digitCount, 0); | |
| while (mpz_cmp_ui(sourceNumber, 0)) { | |
| mpz_div_ui(sourceNumber, sourceNumber, 10); | |
| mpz_add_ui(digitCount, digitCount, 1); |
This file contains hidden or 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
| package main | |
| import ( | |
| "bytes" | |
| "encoding/json" | |
| "fmt" | |
| "io/ioutil" | |
| "log" | |
| "net/http" |
This file contains hidden or 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
| package main | |
| import ( | |
| "fmt" | |
| "github.com/mailjet/mailjet-apiv3-go" | |
| ) | |
| func main() { | |
| publicKey := "XXXXX" |
This file contains hidden or 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 express = require('express'); | |
| const Router = express.Router(); | |
| // Controllers | |
| const getController = require('./controllers/get'); | |
| const postController = require('./controllers/post'); | |
| Router.get('/', getController); | |
| Router.post('/', postController); |
This file contains hidden or 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 express = require('express'); | |
| const app = express(); | |
| // const path = require('path'); | |
| // const config = require('./config').config; Configuration | |
| // const routes = require('./routes'); Routes | |
| // Common Middleware uncomment and npm install when required | |
| // const cors = require('cors'); | |
| // const bodyparser = require('body-parser'); |
This file contains hidden or 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 |