Skip to content

Instantly share code, notes, and snippets.

View julienreszka's full-sized avatar

Julien Henri Reszka julienreszka

View GitHub Profile
// demo_mongodb_find_fields.js
var MongoClient = require('mongodb').MongoClient;
var url = "mongodb://localhost:27017/";
MongoClient.connect(url, (err, db) => {
if (err) throw err;
var dbo = db.db("mydb");
dbo
.collection("customers")
@julienreszka
julienreszka / gist:f0c4ebe29937e40b985c14dd0c9b975e
Last active November 15, 2019 12:31
Youtube cumulated attention on a video
var viewsNb = Number(document.querySelector('.view-count').textContent.split(' ')[0].split(',').join(''));
var videoDuration = document.querySelector('video').getDuration();
var cumulatedAttentionInSeconds = viewsNb * videoDuration;
var cumulatedAttentionInMinutes = cumulatedAttentionInSeconds / 60;
var cumulatedAttentionInHours = cumulatedAttentionInMinutes / 60;
var cumulatedAttentionInDays = cumulatedAttentionInHours / 24;
var cumulatedAttentionInWeeks = cumulatedAttentionInDays / 7;
var cumulatedAttentionInMonths = cumulatedAttentionInWeeks / 4;
var cumulatedAttentionInYears = cumulatedAttentionInMonths / 12;
var cumulatedAttentionInDecades = cumulatedAttentionInYears / 12;
@julienreszka
julienreszka / gist:3c704c2cba19ce0f57d88d941a0c418c
Created November 15, 2019 13:05
get first image from pexels search query
// https://www.pexels.com/search/test/
var firstImage = document.querySelectorAll('.photo-item__link>img')[1].getAttribute('src');
var playlist = []
var i = 4;
listSize = document
.querySelectorAll(
'.ytd-playlist-video-list-renderer'
).length
for(
i;

Titre préliminaire : De la publication, des effets et de l'application des lois en général Article 1 En savoir plus sur cet article... Modifié par Ordonnance n°2004-164 du 20 février 2004 - art. 1 JORF 21 février 2004 en vigueur le 1er juin 2004 Les lois et, lorsqu'ils sont publiés au Journal officiel de la République française, les actes administratifs entrent en vigueur à la date qu'ils fixent ou, à défaut, le lendemain de leur publication. Toutefois, l'entrée en vigueur de celles de leurs dispositions dont l'exécution nécessite des mesures d'application est reportée à la date d'entrée en vigueur de ces mesures.

En cas d'urgence, entrent en vigueur dès leur publication les lois dont le décret de promulgation le prescrit et les actes administratifs pour lesquels le Gouvernement l'ordonne par une disposition spéciale.

Les dispositions du présent article ne sont pas applicables aux actes individuels.

Article 2 En savoir plus sur cet article...

Titre Ier : Des droits civils

Article 7

Créé par Loi 1803-03-08 promulguée le 18 mars 1803

Modifié par Loi n°94-653 du 29 juillet 1994 - art. 1 JORF 30 juillet 1994

L'exercice des droits civils est indépendant de l'exercice des droits politiques, lesquels s'acquièrent et se conservent conformément aux lois constitutionnelles et électorales.

var articles = []; document.querySelectorAll('.article').forEach((article)=> {articles.push(article.querySelector('.corpsArt').textContent)})

Introduction :: AFGHANISTAN Background:This entry usually highlights major historic events and current issues and may include a statement about one or two key future trends.Background field listing Ahmad Shah DURRANI unified the Pashtun tribes and founded Afghanistan in 1747. The country served as a buffer between the British and Russian Empires until it won independence from notional British control in 1919. A brief experiment in democracy ended in a 1973 coup and a 1978 communist countercoup. The Soviet Union invaded in 1979 to support the tottering Afghan communist regime, touching off a long and destructive war. The USSR withdrew in 1989 under relentless pressure by internationally supported anti-communist mujahidin rebels. A series of subsequent civil wars saw Kabul finally fall in 1996 to the Taliban, a hardline Pakistani-sponsored movement that emerged in 1994 to end the country's civil war and anarchy. Following the 11 September 2001 terrorist attacks, a US, Allied, and anti-Taliban Northern Alliance

javascript:(function(){document.querySelectorAll(`path[stroke-linecap='round']`).forEach(el => {el.parentElement.parentElement.parentElement.click()})})()
function unretweet() {
document.querySelectorAll(
'.r-nw8l94' // find the class with the green color
).forEach((retweet)=>{retweet.click()})
document.querySelectorAll('div[data-testid="unretweetConfirm"]').forEach((retweet)=>{retweet.click()})
}
function anihilate() {
unretweet()
document.querySelectorAll(