Skip to content

Instantly share code, notes, and snippets.

View MrModest's full-sized avatar

Kamil MrModest

View GitHub Profile
@weslleih
weslleih / date.extensions.ts
Last active April 23, 2025 20:15
Extend the TypeScript Date Object with some useful methods
export {}
declare global {
interface Date {
addDays(days: number, useThis?: boolean): Date;
isToday(): boolean;
clone(): Date;
isAnotherMonth(date: Date): boolean;
isWeekend(): boolean;
isSameDate(date: Date): boolean;
@JorjMcKie
JorjMcKie / LeoAccess.py
Last active March 16, 2025 05:07
Accessing dictionary dict.leo.org from Python
#!/usr/bin/env python
# -*- coding: latin-1 -*-
#
# Query the dictionary http://dict.leo.org/ from within Python.
# This is based on an equivalent script for German/English by:
#
# Copyright (C) 2015 Ian Denhardt <[email protected]>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@vkobel
vkobel / underscoreCase.cs
Created August 7, 2014 14:22
Simple C# extension method to convert a camel case string to underscore notation without any regex
public static class ExtensionMethods {
public static string ToUnderscoreCase(this string str) {
return string.Concat(str.Select((x, i) => i > 0 && char.IsUpper(x) ? "_" + x.ToString() : x.ToString())).ToLower();
}
}
@aksakalli
aksakalli / SimpleHTTPServer.cs
Last active January 4, 2025 06:04
SimpleHTTPServer in C#
// MIT License - Copyright (c) 2016 Can Güney Aksakalli
// https://aksakalli.github.io/2014/02/24/simple-http-server-with-csparp.html
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net.Sockets;
using System.Net;
using System.IO;