Skip to content

Instantly share code, notes, and snippets.

View PeterPorzuczek's full-sized avatar
♾️
To infinity and beyond!

Piotr Porzuczek PeterPorzuczek

♾️
To infinity and beyond!
View GitHub Profile
const episodesList = "https://raw.githubusercontent.com/Sniadanie-z-Programowaniem/sniadanie-z-programowaniem-links/4eb37de1043705f6c1d104b6173cfb542f9c9708/README.md";
const episodesListWithMissingLinks = "https://raw.githubusercontent.com/Sniadanie-z-Programowaniem/sniadanie-z-programowaniem-links/master/README.md";
fetch(episodesList)
.then(response => response.text())
.then(text => {
const episodes = {
numbers: countEpisodeNumbersFrom(text),
last: countLastEpisodeNumberFrom(text),
// I believe in code reuse so Ctrl-C and Ctrl-V in console of YT page :-> Enjoy :-)
// It may not work since YT records site usage and not accepts recognized patterns
document.getElementById('simplebox-placeholder').focus();
for(var i = 0; i < 120; i++) {
setTimeout(function (x) {
document.getElementById('contenteditable-root').textContent = "To jest " + x + " odcinek front-endowy";
document.getElementById('submit-button').disabled = false;
document.getElementById('submit-button').click();
}.bind(this, i), i * 15000);
input[type="range"] {
-webkit-appearance: none;
-webkit-tap-highlight-color: rgba(255, 255, 255, 0);
width: 100%;
height: 20px;
margin: 0;
border: none;
padding: 1px 2px;
border-radius: 14px;
background: #ffffff;
@PeterPorzuczek
PeterPorzuczek / edit-elements-in-json.js
Last active July 12, 2019 20:56
Edit JSON file and save output | Alternative with Imgur image reupload
const fs = require('fs');
function storeData(data, pathWithName) {
fs.writeFileSync(`${pathWithName}.json`, JSON.stringify(data));
return data;
}
function readData(pathWithName) {
var data = fs.readFileSync(`${pathWithName}.json`);
@PeterPorzuczek
PeterPorzuczek / uuid4.js
Last active July 12, 2019 20:55
Generate UUID4
function uuid4() {
var uuid = '', ii;
for (ii = 0; ii < 32; ii += 1) {
switch (ii) {
case 8:
case 20:
uuid += '-';
uuid += (Math.random() * 16 | 0).toString(16);
break;
case 12:
@PeterPorzuczek
PeterPorzuczek / commit-filler.bat
Last active July 12, 2019 20:57
Batch Windows script filling commits with changes for whole month
@echo off
set loopcount=31
:loop
echo. >> README.MD
git add .
git commit --date="Dec %loopcount% 20:00:00 2019 -0600" -m "Filling holes"
echo %loopcount%
set /a loopcount=loopcount-1
if %loopcount%==0 goto exitloop
goto loop