Skip to content

Instantly share code, notes, and snippets.

View MichaelStett's full-sized avatar

Michał Tymejczyk MichaelStett

  • Kongsberg
  • Szczecin
  • 12:14 (UTC +02:00)
View GitHub Profile
@MichaelStett
MichaelStett / main.py
Created May 16, 2023 11:21
Replace text
import os
path = ""
fileType = ".xml"
dictionary = {
"oldvalue": "newvalue",
}
modified = False
@MichaelStett
MichaelStett / main.py
Created May 16, 2023 11:07
Create server on given ip
import http.server
import socketserver
import sys
PORT = int(sys.argv[1])
print(f"Port {PORT}")
if PORT == "":
exit(-1)
@MichaelStett
MichaelStett / Program.cs
Created September 29, 2022 08:57
Bot discord
using Discord;
using Discord.WebSocket;
namespace DiscordBotTest;
internal class Program
{
private const string Token = "";
private readonly DiscordSocketClient _client;
using System;
namespace Project.Extensions
{
public static class LocalDateExtension
{
private static int DayCount(in int month) => (month % 2 != 0) ? 31 : 30;
private static object ValidateNumberOfDays(in int day, in int month)
=> (day > DayCount(month)) ? throw new Exception() : default;
from sklearn.base import BaseEstimator, ClassifierMixin
import numpy as np
class SimplePerceptron(BaseEstimator, ClassifierMixin):
def __init__(self, eta=1.0):
self.class_labels_ = None
self.w_ = None # wagi
self.k_ = None # liczba kroków algorytmu
self.eta_ = eta # współczynnik uczenia
using System.Linq;
namespace Day2
{
public class Password
{
private PasswordPolicy _policy { get; set; }
private string _password { get; set; }
public Password(PasswordPolicy policy, string password)
@MichaelStett
MichaelStett / activation.sh
Last active March 14, 2024 13:34
Windows 10 Activation script
@echo off
title Activate Windows 10 ALL versions for FREE! WireDroid.com&cls&echo ============================================================================&echo #Project: Activating Microsoft software products for FREE without software(WireDroid.com)&echo ============================================================================&echo.&echo #Supported products:&echo - Windows 10 Home&echo - Windows 10 Home N&echo - Windows 10 Home Single Language&echo - Windows 10 Home Country Specific&echo - Windows 10 Professional&echo - Windows 10 Professional N&echo - Windows 10 Education N&echo - Windows 10 Education N&echo - Windows 10 Enterprise&echo - Windows 10 Enterprise N&echo - Windows 10 Enterprise LTSB&echo - Windows 10 Enterprise LTSB N&echo.&echo.&echo ============================================================================&echo Activating your Windows...&cscript //nologo slmgr.vbs /upk >nul&cscript //nologo slmgr.vbs /cpky >nul&wmic os | findstr /I "enterprise" >nul
if %errorlevel% EQU 0 (cscript //no
@MichaelStett
MichaelStett / script.js
Last active November 3, 2020 11:00
Script #4
let isEditingAlready = false;
let editedElementId = null;
window.addEventListener('click', (event) => {
if (event.target.type == "text" && (event.target.id !== 'addTodoInput' && event.target.id !== 'searchInput')) {
if (!isEditingAlready)
{
console.log("Start editing...");
event.target.disabled = false;
@MichaelStett
MichaelStett / script.js
Created November 3, 2020 10:41
Script #3
const filterTodoList = (word) =>{
return todos.filter((item) => {
return item.desc.toLowerCase().includes(word.toLowerCase());
});
};
searchInput.addEventListener('input', (event) => {
event.preventDefault();
if (event.target.value.length >= 3){
@MichaelStett
MichaelStett / script.js
Last active November 3, 2020 10:34
Script #2
const addTodo = (desc, date) => {
let todo = new Todo(desc, date);
console.log(`Add Task... ${todo.id}`);
todos.push(todo);
localStorage.setItem('todos', JSON.stringify(todos));
// resetowanie wartości pól
addTodoInput.value = addTodoInput.defaultValue;