Skip to content

Instantly share code, notes, and snippets.

View rexim's full-sized avatar
📺
https://twitch.tv/tsoding

Alexey Kutepov rexim

📺
https://twitch.tv/tsoding
View GitHub Profile
@rexim
rexim / gol.adb
Last active January 24, 2021 09:32
Game of Life in Ada
-- $ gnatmake gol.adb
-- $ ./gol
with Ada.Text_IO;
procedure Gol is
use Ada.Text_IO;
Width : constant Integer := 10;
Height : constant Integer := 10;
@rexim
rexim / Main.hs
Last active June 15, 2023 17:15
Epic Screencast Adder PauseChamp
module Main where
import qualified Data.Text as T
import qualified Data.Text.IO as T
import System.Directory
import Data.Functor
-- NOTE: Yt stands for YouTube. It's a YouTube link to the video
type Yt = T.Text
@rexim
rexim / main.d
Created October 9, 2020 11:58
Game of Life in D
import std.stdio;
import std.traits;
import core.thread.osthread;
import core.time;
enum Cell {
Dead = 0,
Alive
}
@rexim
rexim / main.cpp
Created October 7, 2020 12:19
PCRE2 C++ example with named capture groups
#define PCRE2_CODE_UNIT_WIDTH 8
#include <stdio.h>
#include <string.h>
#include <pcre2.h>
#define MY_PATTERN "\\[(?<hours>\\d+):(?<minutes>\\d+):(?<seconds>\\d+)(\\.(?<milliseconds>\\d+))?\\] \\<(?<nickname>\\w+)\\> (?<message>.*)"
#define MY_SUBJECT "[0:00:01] <Tsoding> forsenPls forsenPls forsenPls forsenPls forsenPls forsenPls forsenPls forsenPls forsenPls forsenPls"
const char *line_comps[] = {
module Main where
import Data.Maybe
import Data.List
-- Solution for https://www.geeksforgeeks.org/averages-levels-binary-tree/
data Tree a
= Node a (Tree a) (Tree a)
| Leaf
@rexim
rexim / Main.hs
Created September 24, 2020 13:07
Somebody's Homework that I did for free
module Main where
-- https://i.imgur.com/mA5EEWI.png
import Control.Exception
import Data.List
import Data.Maybe
import Data.Foldable
data Tree a
mod memory {
use std::marker::PhantomData;
#[derive(Clone, Copy)]
pub struct Ptr<T> {
offset: usize,
phantom: PhantomData<T>
}
impl<T> Ptr<T> {
program rot13;
{
Byte = 1 byte
ShortInt = 2 bytes
Integer = 4 bytes
}
function rot13(x : char): char;
var
program gui;
{$H+}
uses
crt,
xlib,
x,
ctypes;
@rexim
rexim / Friday.org
Last active September 25, 2020 05:27

Friday Queue

Use !friday command to put a video here (only for trusted and subs). Any video can be skipped if the streamer finds it boring.

tsoding

Video Count: 2

DateSubmitterVideoThumbnail