Skip to content

Instantly share code, notes, and snippets.

View skorotkiewicz's full-sized avatar
💻
Programming

Sebastian Korotkiewicz skorotkiewicz

💻
Programming
View GitHub Profile
@skorotkiewicz
skorotkiewicz / date_password.js
Created February 27, 2023 08:00
JavaScript code to generate a unique password for each day
// Pobierz obecną datę
const now = new Date();
// Utwórz unikalny seed dla danego dnia
const seed = now.getFullYear() * 1000 + now.getMonth() * 100 + now.getDate();
// Zainicjuj generator liczb pseudolosowych z seedem
const m = 0x80000000;
let a = 1103515245;
let c = 12345;
import random from "random";
import readline from "readline-sync";
// Stwórz tablicę z dostępnymi słowami do wyboru
const words = ["słońce", "deszcz", "drzewo", "samochód", "komputer"];
// Wybierz losowe słowo z tablicy
const targetWord = words[random.int(0, words.length - 1)];
// Stwórz tablicę z gwiazdkami o długości słowa
const wordArray = new Array(targetWord.length).fill("*");
@skorotkiewicz
skorotkiewicz / README.md
Last active August 19, 2022 06:40
Retropie config for Steam Controller

Here are the different signals that the Steam Controller will send for the different buttons, and what you need in your .emulationstation/es_input.cfg for EmulationStation to react to them.

Left D-PAD The left D-PAD will send "hat" signals when you just touch it, and "button" signals when you press hard enough to actually click. Use this for touch-sensitive up/down/left/right:

    <input name="up" type="hat" id="0" value="1"/>
    <input name="down" type="hat" id="0" value="4"/>
    <input name="left" type="hat" id="0" value="8"/>
 
@skorotkiewicz
skorotkiewicz / imiona.js
Created February 13, 2020 02:49
Tablica dla polskich imion żeńskich i męskich
const menskie = ['Aaron','Abdon','Abel','Abelard','Abraham','Achilles','Adam','Adelard','Adnan','Adrian','Agapit','Agaton','Agrypin','Ajdin','Albert','Alan','Albin','Albrecht','Aleks','Aleksander','Aleksy','Alfons','Alfred','Alojzy','Alwin','Amadeusz','Ambroży','Anastazy','Ananiasz','Anatol','Andrzej','Anioł','Annasz','Antoni','Antonin','Antonius','Anzelm','Apolinary','Apollo','Apoloniusz','Ariel','Arkadiusz','Arkady','Arnold','Aron','Artur','August','Augustyn','Aurelian','Aureliusz','Baldwin','Baltazar','Barabasz','Barnaba','Barnim','Bartłomiej','Bartosz','Bazyli','Beat','Benedykt','Beniamin','Benon','Bernard','Bert','Błażej','Bodosław','Bogdał','Bogdan','Boguchwał','Bogumił','Bogumir','Bogusław','Bogusz','Bolebor','Bolelut','Bolesław','Bonawentura','Bonifacy','Borys','Borysław','Borzywoj','Bożan','Bożidar','Bożydar','Bożimir','Brajan','Bromir','Bronisław','Bruno','Brunon','Budzisław','Cecyl','Cecylian','Celestyn','Cezar','Cezary','Chociemir','Chrystian','Chwalibóg','Chwalimir','Chwalisław','Cichosław','Ciec
Byobu is a suite of enhancements to tmux, as a command line
tool providing live system status, dynamic window management,
and some convenient keybindings:
F1 * Used by X11 *
Shift-F1 Display this help
F2 Create a new window
Shift-F2 Create a horizontal split
Ctrl-F2 Create a vertical split
Ctrl-Shift-F2 Create a new session
@skorotkiewicz
skorotkiewicz / wordle.md
Created February 3, 2022 01:41 — forked from huytd/wordle.md
Wordle in less than 50 lines of Bash

image

How to use:

./wordle.sh

Or try the unlimit mode:

@skorotkiewicz
skorotkiewicz / irc.md
Last active October 13, 2021 01:20 — forked from xero/irc.md
irc cheat sheet

IRC Reference

Not intended as a guide for newbies, more like a "cheat sheet" for the somewhat experienced IRC user, especially one who wields some power over a channel.

The Basics

  • /join #channel
    • Joins the specified channel.
  • /part #channel
  • Leaves the specified channel.
@skorotkiewicz
skorotkiewicz / multipleParser.js
Last active June 22, 2021 03:01
React Linkify - Simple Create Clickable Hashtags, Mentions etc...
import { createElement } from "react"
export const parser = (text) => {
let hashtag = /(#[\w]+)/g // parse: #test
let user = /(\^[\w]+)/g // parse: ^test
let blog = /(\/s\/[\d]+)/g // parse: /s/123
let url = /(\b(https?):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/gi
return text.split(hashtag).map((chunk) => {
return chunk.split(user).map((chunk) => {
#!/bin/bash
# IMPORTANT: Don't forget to logout from your Apple ID in the settings before running it!
# IMPORTANT: You will need to run this script from Recovery. In fact, macOS Catalina brings read-only filesystem which prevent this script from working from the main OS.
# This script needs to be run from the volume you wish to use.
# E.g. run it like this: cd /Volumes/Macintosh\ HD && sh /Volumes/Macintosh\ HD/Users/sabri/Desktop/disable.sh
# WARNING: It might disable things that you may not like. Please double check the services in the TODISABLE vars.
# Get active services: launchctl list | grep -v "\-\t0"
# Find a service: grep -lR [service] /System/Library/Launch* /Library/Launch* ~/Library/LaunchAgents