Skip to content

Instantly share code, notes, and snippets.

View trag1c's full-sized avatar
🖤
#opentowork

trag1c

🖤
#opentowork
  • Nokia
  • Wrocław, Poland
  • 19:26 (UTC +02:00)
View GitHub Profile
@fnky
fnky / ANSI.md
Last active July 24, 2024 02:06
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27
@fbaierl
fbaierl / ForkMITLicensedProject.md
Created November 6, 2018 14:17
HOWTO fork a MIT licensed project

No, you are not allowed to change the copyright notice. Indeed, the license text states pretty clearly:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

But you are allowed to add a copyright notice.

If you want to keep the MIT license, which is what I would advise you to do, you only need to add a single line to the license file, before or after Copyright (c) 2012 Some Name with your own copyright notice. The final LICENSE file will look like this:

The MIT License (MIT)

@quackbarc
quackbarc / fizzbuzz_regex.md
Last active July 1, 2024 13:37
a fizzbuzz pattern made with pure regex
\b(?:(?<fizzbuzz>(?:(?:[369]|[258][0369]*[147]|(?:[147]|[258][0369]*[258])(?:[0369]|[147][0369]*[258])*(?:[28]|[147][0369]*[147]))*(?:0|(?:[147]|[258][0369]*[258])(?:[0369]|[147][0369]*[258])*5))+)|(?<buzz>\d*[05])|(?<fizz>(?:[0369]|[258][0369]*[147]|(?:[147]|[258][0369]*[258])(?:[0369]|[147][0369]*[258])*(?:[258]|[147][0369]*[147]))+))\b

insanity, as i'd like to call it. although it isn't fizzbuzz per se, it's the best you can get with regex. here's a regexr link to it with sample text.

this matches a number (within word boundaries) if it falls under any of the three groups:

  • fizzbuzz, which picks up numbers divisible by both 3 and 5, i.e. 15;
  • buzz, which picks up numbers divisible by 5; and
  • fizz, which picks up numbers divisible by 3.