Skip to content

Instantly share code, notes, and snippets.

View sorashi's full-sized avatar

Dennis Pražák sorashi

View GitHub Profile
@sorashi
sorashi / Fraction.cs
Last active June 9, 2021 03:23
The base for a fraction class. Can be used to represent rational numbers precisely.
using System;
using System.Text.RegularExpressions;
public class Fraction
{
private int denominator = 1;
private int nominator = 0;
public Fraction() {
}

Keybase proof

I hereby claim:

  • I am sorashi on github.
  • I am sorashi (https://keybase.io/sorashi) on keybase.
  • I have a public key ASBwT6rSA3IN9ucBeb8lFArMNi-s_EyVCmw3_U013Ulv9wo

To claim this, I am signing this object:

@sorashi
sorashi / czechia.md
Last active August 2, 2017 08:14
Czechia, the short name of the Czech Republic

Czechia (Czech Republic)

The geographical name Czechia was officially announced when the state started to exist on its own in 1993. The reason why it is not known is because the Czech state and its institutions have not used it. A short country name that is not used by the state itself and by its institutions cannot become well known and recognized abroad.

Czechia is listed in UNTERM.

Some examples to make the difference between a political and a geographical name clear

@sorashi
sorashi / twitch-irc-recieved-message.regex
Created March 4, 2016 19:27
RegEx for pulling out information from Twitch IRC messages recieved in a channel
^:(?<user>[a-zA-Z0-9_]{4,25})!\1@\1\.tmi\.twitch\.tv PRIVMSG #(?<channel>[a-zA-Z0-9_]{4,25}) :(?<message>.+)$
@sorashi
sorashi / kana.txt
Last active March 7, 2024 07:59 — forked from Cybuster/kana
Kana and kanji list for development purposes
Katakana Codes
ァアィイゥウェエォオカガキギクグケゲコゴサザシジスズセゼソゾタダチヂッツヅテデトドナニヌネノハバパヒビピフブプヘベペホボポマミムメモャヤュユョヨラリルレロヮワヰヱヲンヴヵヶヷヸヹヺ・
Basic Katakana
アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワヲン
Punctuation and Symbols
゛゜ーヽヾ
Phonetic Extensions for Ainu
@sorashi
sorashi / 1000-7.py
Created January 19, 2016 17:49
Tokyo Ghoul reference
import time
now=time.time()
c=1000
while c>0:
print c
c-=7
print "Hello, Tokyo! It took me "+str(round((time.time()-now)*1000,3))+"ms to count down from 1000, decreasing by 7."
@sorashi
sorashi / UserDecision.cs
Last active June 9, 2021 03:23
A method that asks user for an answer, validates if the answer is right and returns the desired value. If the answer is invalid, it asks the user again.
private static object GetUserDecision(string question, Type typeToReturn, Func<object, bool> validator)
{
string answer;
if (typeToReturn == typeof(bool))
{
do
{
Write(question + " (y/n) ");
answer = Console.ReadLine();
answer = answer.ToLower().Trim();