Skip to content

Instantly share code, notes, and snippets.

View filiptronicek's full-sized avatar
🐢
Doing awesome stuff

Filip Troníček filiptronicek

🐢
Doing awesome stuff
View GitHub Profile
@filiptronicek
filiptronicek / pr.md
Last active October 7, 2022 08:44
VS Code Insiders PR for Gitpod

Description

Update code to 1.x.x

How to test

  • Switch to VS Code Insiders in settings.
  • Start a workspace.
  • Test following:
    • terminals are preserved and resized properly between window reloads
  • WebViews are working
@filiptronicek
filiptronicek / index.js
Created September 26, 2022 13:37
Release notes parser - tailored to the new proposed Gitpod Changelog process
import { readFile } from "fs/promises";
import { unified } from "unified/lib/index.js";
import remarkParse from "remark-parse";
const file = await readFile("files/file.md", "utf8");
const data = unified().use(remarkParse).parse(file);
const releaseNotesStart = data.children.find(
@filiptronicek
filiptronicek / marketplace.json
Last active July 12, 2022 16:12
Malicious test
{
"malicious": [
"ms-python.python"
],
"deprecated": {},
"migrateToPreRelease": {}
}
@filiptronicek
filiptronicek / 3n+1.py
Created October 8, 2021 07:55
💀🤌🔥
ns = []
def compt(n):
ns.append(n)
if n == 1:
return
if n % 2 == 0:
n = n/2
else:
n = (3*n)+1
compt(n)
@filiptronicek
filiptronicek / index.php
Created October 3, 2021 11:07
Check if a link is accessible via IPFS in PHP
<?php
/**
* Checks if a given `$url` is hosted on IPFS
*
* @param string $url
* @return bool
*/
function checkIPFS($url)
{
@filiptronicek
filiptronicek / colors.json
Created August 16, 2021 21:47
Awesome VS Code colors (don't try at home)
{
"workbench.colorCustomizations": {
"titleBar.activeBackground": "#ffffff",
"debugConsole.errorForeground": "#ffffff",
"titleBar.activeForeground": "#ffffff",
"sideBar.background": "#ffffff",
"editor.background": "#ffffff",
"window.zoomLevel": 20,
"editor.foreground": "#ffffff",
"sideBar.foreground": "#ffffff",
@filiptronicek
filiptronicek / paper.py
Created January 25, 2021 13:56
Update your local Paper MC version
import requests
import re
import json
import os
req = requests.get("https://papermc.io/api/v2/projects/paper/version_group/1.16/builds").text
releases = json.loads(req)
download = 'https://papermc.io/api/v2/projects/paper/versions/'+releases['builds'][-1]['version'] + '/builds/' + str(releases['builds'][-1]['build']) + '/downloads/'+releases['builds'][-1]['downloads']['application']['name']
@filiptronicek
filiptronicek / script.js
Created January 22, 2021 17:51
Get all smileys from W3Schools
const nodes = document.querySelectorAll("html body div#belowtopnav.w3-main.w3-light-grey div.w3-row.w3-white div#main.w3-col.l10.m12 div.w3-responsive table.w3-table-all.charset-tryit tbody tr td:first-child")
const emojis = [];
for (const node of nodes) {
emojis.push(node.innerText)
}
console.log(JSON.stringify(emojis))
@filiptronicek
filiptronicek / time.js
Last active November 27, 2020 12:15
Get time difference between server and client
const timestamp = Date.now();
fetch(`https://time.filiptronicek.workers.dev/?ts=${timestamp}`).then(f => f.json()).then(f => {
const nowstamp = Date.now()
console.table({adjusted: Math.round(f.result.ms - (nowstamp - timestamp) / 2), raw: f.result.ms})
})
@filiptronicek
filiptronicek / worker.js
Created October 27, 2020 12:02
Minecraft latest version Cloudflare Worker
const url = "https://launchermeta.mojang.com/mc/game/version_manifest.json";
async function gatherResponse(response) {
const { headers } = response;
const contentType = headers.get("content-type") || "";
return (await response.json());
}
async function handleRequest() {
const init = {