Skip to content

Instantly share code, notes, and snippets.

View ahmed-com's full-sized avatar
:octocat:

Ahmed Mamdouh ahmed-com

:octocat:
  • egypt
View GitHub Profile
const https = require('https');
const fs = require('fs');
let counter = 13;
const options = {
hostname: 'thispersondoesnotexist.com',
port: 443,
path: '/image',
method: 'GET',
We can't make this file beautiful and searchable because it's too large.
period,timedelta,t0,t1,bt_mean,bt_std,temperature_mean,temperature_std,bx_gse_mean,bx_gse_std,by_gse_mean,by_gse_std,bz_gse_mean,bz_gse_std,speed_mean,speed_std,density_mean,density_std,smoothed_ssn
train_a,0 days 00:00:00,-7,-10.0,0.49970532366948717,2.4436140803959687,-0.3752665004835809,0.3839412822567737,-1.5992074153894456,-0.38150216163321726,0.4195158029812593,0.03165830444038482,0.30035778610154507,-0.6516454814208527,-0.7385455257009498,0.8625240966985511,-0.7758265275046501,-0.20572399054908272,0.13944356356886858
train_a,0 days 01:00:00,-10,-10.0,0.5471770553440168,-0.22457957391665773,-0.47942960930030926,0.9531776504071194,-1.7579954737469898,-0.8677472757793793,0.1792574898251977,-0.2729710778945457,0.44610304845318594,-0.5179131343269985,-0.9869037954545373,0.9950625059280016,-0.8616923938064284,-0.05821529736782652,0.13944356356886858
train_a,0 days 02:00:00,-10,-6.0,0.7399046380226543,-0.7702398210039044,-0.5748310787857642,-0.19251803112243776,-1.9121161550064552,-1.1143165278451193,0.183266
@ahmed-com
ahmed-com / gist:8ee062e605ca35e596dc1391c0002f5b
Created December 27, 2020 07:53
a simple script to run in the browser console to get the total length of youtube playlist
const elements = document.getElementsByClassName('style-scope ytd-thumbnail-overlay-time-status-renderer');
let totalDuration = 0;
for(let el of elements){
if(el.localName === 'span') {
const durationString = el.innerText;
const durationArr = durationString.split(':');
let hours;
@ahmed-com
ahmed-com / db.js
Created December 18, 2020 17:09
a Transaction decorator, operating with a simple Model decorator
/**
* this module only provides the API for what should become the real DB module
*/
const CONNECTION = Symbol('connection');
class DBConnection{
static counter = 0;
constructor(){
DBConnection.counter++;