Skip to content

Instantly share code, notes, and snippets.

@valentinvieriu
valentinvieriu / german-driving-license.md
Created February 27, 2025 18:30 — forked from sahilchopra/german-driving-license.md
Quick Ref Notes for German Driving License Test

https://gist.github.com/ElioLopez/0b725ab7d64690a6144713f8d66ed6e5

https://www.clickclickdrive.de/fragenkatalog/en/1.1.-danger-teaching/1.1.01-basic-forms-of-traffic-behavior#gsc.tab=0

hard shoulder he hard shoulder, also known as the emergency lane or breakdown lane, is the area to the side of a roadway, usually delimited by a solid white line. It's primarily intended for emergency use, such as stopping in case of a breakdown, vehicle emergencies, or for emergency services to use.

Roadway The roadway refers to the main driving surface of a road or highway, typically delimited by lane markings. It's where vehicles travel, and it's designed and maintained for regular traffic flow.

Lay-by: A lay-by is a designated area along a road where vehicles can pull off to the side to stop temporarily. It's often used for rest breaks, to make phone calls, or to take in scenic views.

@valentinvieriu
valentinvieriu / Motorcycle.md
Created February 27, 2025 18:30 — forked from sahilchopra/Motorcycle.md
Fahrschule, driving license germany, berlin

Where should a passenger on a motorcycle with sidecar sit to reduce the risk of tipping over on bends?

  • On the motorcycle
  • The position of the occupants has no significance
  • In the sidecar

You notice that the lever travel of the hydraulic front wheel brake on your motorcycle has become considerably longer. What must you do?

  • Have the front wheel brake repaired
  • Fill up the brake fluid immediately
  • Only use the rear wheel brake until the next service
@valentinvieriu
valentinvieriu / EurojackpotGenerator.js
Last active December 19, 2024 14:41
I use this script to generate Eurojackpot numbers for https://www.lotto-bayern.de/
// https://lotterycodex.com/eurojackpot-550/
// Generate a unique ticket number
const ticketNo = [...Array(7).keys()].map((i) => Math.floor(cryptoRandom() * 9)).join('');
const numberOfTickets = 12;
const drawings = [5]; // 5 - Friday; 4 - Wednesday ; 8 - Both
// Initialize the data object to be sent to the server
let data = {
"type": "JS",
@valentinvieriu
valentinvieriu / worker.js
Last active October 9, 2023 13:19
Simple Cloudflare Worker using new GPU Workers - https://ai.cloudflare.com/?gpu
import { Ai } from './vendor/@cloudflare/ai';
let topics = ["Exploring Determinism: Are All Actions Influenced by Prior Causes?","Examining the Validity of All Beliefs: A Deep Dive","The Freedom Paradigm: Are Animals Freer Than Humans?","A Comparative Analysis: Are Animals Similar to Humans?","Happiness in Different Experiences: Are Some Types Inherently Happier?","The Morality of Children: Are They Born Good or Evil?","Innate Affection: Are Children Born with Love for Their Parents?","The Significance of Dreams: An Exploration","Emotions and Rationality: How Do They Interact?","Differentiating Between Freedom and Liberty","The Universality of Human Rights: A Critical Examination","Altruism Vs. Self-interest in Humans: A Study on True Altruism","The Rationality Quotient: Are Humans Fundamentally Rational or Irrational?","Evaluating Human Value: Are All Humans Inherently Equal?","The Nature of Humans: Are We Inherently Good or Bad?","Selfishness Vs. Selflessness in Humans: An In-depth Analysis","Beyond Biologi
#!/bin/bash
# Remove terminating namespaces
# Usage: ./remove-terminating-ns.sh
TERMINATING_NS=$(kubectl get ns | grep Terminating | awk '{print $1}')
kubectl proxy &
PROXY_PID=$!
@valentinvieriu
valentinvieriu / random-domain-name.js
Created October 11, 2020 08:22 — forked from solrevdev/random-domain-name.js
gets a random domain name from https://www.domainsfortherestofus.com/ via cors-anywhere
(async function () {
const response = await fetch('https://cors-anywhere.herokuapp.com/https://www.domainsfortherestofus.com/');
const text = await response.text();
const parser = new DOMParser();
const document = parser.parseFromString(text, 'text/html');
const domain = document.querySelector("body > div.content > div > div > div.left-side > div.domain > a").text;
console.log('domain', domain);
})();
@valentinvieriu
valentinvieriu / name.js
Created August 9, 2019 02:10 — forked from tkon99/name.js
Random Name Generator for Javascript
/*
(c) by Thomas Konings
Random Name Generator for Javascript
*/
function capFirst(string) {
return string.charAt(0).toUpperCase() + string.slice(1);
}
function getRandomInt(min, max) {
// Allows random intervals that do not start with 1. So you can get a random number from 10 to 15 for example.
function randomIntFromInterval(min,max)
{
return Math.floor( Math.random()* ( max - min + 1 ) + min );
}
@valentinvieriu
valentinvieriu / uuidv4.js
Created August 7, 2019 17:38 — forked from spyesx/uuidv4.js
Generate UUIDv4 in JS
function uuidv4() {
return ([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g, c =>
(c ^ crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> c / 4).toString(16)
)
}
@valentinvieriu
valentinvieriu / camelCaseToDash.js
Created March 30, 2018 07:00
Javascript convert camelcase to dash (hyphen)
/**
* camelCaseToDash('userId') => "user-id"
* camelCaseToDash('waitAMoment') => "wait-a-moment"
* camelCaseToDash('TurboPascal') => "turbo-pascal"
*/
function camelCaseToDash (str) {
return str.replace(/([a-zA-Z])(?=[A-Z])/g, '$1-').toLowerCase()
}