/r/tinycode

Photograph via snooOG

This subreddit is about minimalistic, often but not always simple implementations of just about everything. tiny code / minimalistic programming / yagni / kiss / dry

TL;DR: Low line count, high quality

This subreddit is about minimalistic, often but not always simple implementations of just about everything.

PLEASE NOTE: This Subreddit is NOT about CodeGolf and obfuscation!

_______Low line count, high quality!_______

  • Webserver in 42 lines of code? Great!
  • A wiki engine smaller than your usual MVC controller? Awesome!
  • Tiny games that somehow kicks ass? Sure!
  • That one liner that fulfills your deepest desires? You got it!
  • An exploit so small and elegant to make you drool? Maybe even that!
  • Open source alternatives to common bloatware? Most definitely!

I'm sure you get the idea by now ;) ...

Remember: "Tiny depends on what you're doing. A tiny box, a tiny house, and a tiny country are very different sizes." - snarkyxanf

In other words: Try to aim for stuff that makes you go "wow!" instead of "huh?" ;)

Also look into:

Other Subreddits that might interest you:

/r/tinycode

25,069 Subscribers

7

Dweet of the Week #57 - Cemetery of Deleted Dweets by Rodrigo Siqueira

1 Comment
2025/01/24
18:09 UTC

15

Dweet of the Week #56 - Alien Hive by Rodrigo Siqueira

2 Comments
2025/01/19
15:34 UTC

14

Dweet of the Week #55 - 360° Camera in Starfield by cantelope

1 Comment
2025/01/10
20:47 UTC

33

genuary10 - use only tau - float l,i,T=6.283185;vec3 q,d=vec3((FC.xy+FC.xy-r)/min(r.x,r.y),-T/T),v,p=v=vec3(0,0,T+T);for(;++i<exp(T);){q=p*rotate3D(t,v+T);p+=d*(length(vec2(length(q.xy)-T+sin(atan(q.y,q.x)*floor(T)),q.z))-sqrt(T));};o.xyz+=cos(q*T)+p.z/T;

1 Comment
2025/01/10
18:32 UTC

6

Top 10 Dweets of 2024! (Limited to one per person)

0 Comments
2025/01/03
18:03 UTC

15

Dweet of the Week #54 Noise Warping by KilledByAPixel

1 Comment
2025/01/03
17:51 UTC

11

162 byte quine program in x86-64 machine code

# >>>>>>>>>>>>>>>>>>>>> ELF FILE HEADER <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
                        # All numbers (except in names) are in base sixteen (hexadecimal)
                        # 00 <- number of bytes listed so far
7F 45 4C 46             # 04 e_ident[EI_MAG]: ELF magic number
02                      # 05 e_ident[EI_CLASS]: 1: 32-bit, 2: 64-bit
   01                   # 06 e_ident[EI_DATA]: 1: little-endian, 2: big-endian
      01                # 07 e_ident[EI_VERSION]: ELF header version; must be 1
         00             # 08 e_ident[EI_OSABI]: Target OS ABI; should be 0

00                      # 09 e_ident[EI_ABIVERSION]: ABI version; 0 is ok for Linux
   00 00 00             # 0C e_ident[EI_PAD]: unused, should be 0
00 00 00 00             # 10

02 00                   # 12 e_type: object file type; 2: executable
      3E 00             # 14 e_machine: instruction set architecture; 3: x86, 3E: amd64
01 00 00 00             # 18 e_version: ELF identification version; must be 1

78 00 40 00 00 00 00 00 # 20 e_entry: memory address of entry point (where process starts)
40 00 00 00 00 00 00 00 # 28 e_phoff: file offset where program headers begin (34: 32-bit, 40: 64)
00 00 00 00 00 00 00 00 # 30 e_shoff: file offset where section headers begin
00 00 00 00             # 34 e_flags: 0 for x86

40 00                   # 36 e_ehsize: size of this header (34: 32-bit, 40: 64-bit)
      38 00             # 38 e_phentsize: size of each program header (20: 32-bit, 38: 64-bit)
01 00                   # 3A e_phnum: #program headers
      40 00             # 3C e_shentsize: size of each section header (28: 32-bit, 40: 64-bit)
00 00                   # 3E e_shnum: #section headers
      00 00             # 40 e_shstrndx: index of section header containing section names

# >>>>>>>>>>>>>>>>>>>>> ELF PROGRAM HEADER <<<<<<<<<<<<<<<<<<<<<<<<
01 00 00 00             # 44 p_type: segment type; 1: loadable
07 00 00 00             # 48 p_flags: segment-dependent flags (1: X, 2: W, 4: R)

00 00 00 00 00 00 00 00 # 50 p_offset: file offset where segment begins
00 00 40 00 00 00 00 00 # 58 p_vaddr: virtual address of segment in memory (x86: 08048000; amd64: 00400000)
    
00 00 00 00 00 00 00 00 # 60 p_paddr: physical address of segment, unspecified by 386 supplement
A2 00 00 00 00 00 00 00 # 68 p_filesz: size in bytes of the segment in the file image ############

A2 00 C0 00 00 00 00 00 # 70 p_memsz: size in bytes of the segment in memory; p_filesz <= p_memsz
00 10 00 00 00 00 00 00 # 78 p_align: 1000 for x86

# >>>>>>>>>>>>> PROGRAM SEGMENT <<<<<<<<<<<<<

# Entry: 00400078
                             # INTENTION             INSTRUCTION         OPCODE             OFFSET          NOTE
48 c7 c0 01 00 00 00         # mov 1 -> rax          mov rax, 1           c7                  7F
48 c7 c7 01 00 00 00         # mov 1 -> rdi          mov rdi, 1           c7                  86
48 c7 c6 78 00 40 00         # mov program start -> rsi        mov rsi, buf         c7                  8D
48 c7 c2 2A 00 00 00         # mov A2 -> rdx         mov rdx, 11                              94 
0f 05                        # syscall               syscall              0F 05               96

# exit
48 c7 c0 3c 00 00 00         # mov 60 -> rax          mov rax, 60                             9D         
48 31 ff                     # zero out rdi           xor rdi, rdi                            A0
0F 05                        # syscall                syscall                                 A4
2 Comments
2025/01/03
14:12 UTC

50

Merry Dweetmass!

2 Comments
2024/12/24
23:21 UTC

29

52 Dweets of the Week for 2024! 🎉

1 Comment
2024/12/20
18:50 UTC

36

Dweet of the Week #52 Sunset Islands by KilledByAPixel

3 Comments
2024/12/20
16:28 UTC

40

Dweet of the Week #51 Photon-Mapping using a Random-March Scattering Model by Tomxor

1 Comment
2024/12/13
19:53 UTC

4

A simple virtual computer to practice writing compilers

0 Comments
2024/12/13
14:17 UTC

13

Dweet of the Week #50 - Just One More Drop by Rodrigo Siqueira

1 Comment
2024/12/06
18:52 UTC

25

Dweet of the Week #49 - God of Fractals 3D Rotation by Rodrigo Siqueira

1 Comment
2024/11/29
20:53 UTC

18

Dweet of the Week #48 - Sun Mountains by KilledByAPixel

1 Comment
2024/11/22
16:49 UTC

10

Slaughter by mindbleach -- FPS running on the NES hardware

1 Comment
2024/11/22
12:30 UTC

22

Dweet of the Week #47 - Color Tree by Rodrigo Siqueira

1 Comment
2024/11/15
20:17 UTC

33

Dweet of the Week #46 - Pillars of Dwitter HD by Tomxor

2 Comments
2024/11/09
11:22 UTC

35

Dweet of the Week: Ventilation Shaft by tomxor

8 Comments
2024/11/08
01:07 UTC

36

Dweet of The Week: Drilling for Dweets by tomxor

3 Comments
2024/11/08
01:02 UTC

4

Dweet of The Week: Multiple Torus Choreography by Rodrigo Siqueira

1 Comment
2024/11/08
00:50 UTC

11

Fitting Flappy Bird (Assets Included) onto a QR Code

1 Comment
2024/11/03
11:04 UTC

11

Improve Tiny SVG Analog Clock

Hi guys! I’ve implemented the smallest SVG analog clock I could make. Is there a way to make it even smaller or simpler? Alternatively, without adding too much complexity, how can I make it look more appealing? Do you have any suggestions for improvement?

Here’s the CodeSandbox.

const AnalogClock = ({ date = new Date() }) => (
  <div
    mount={(self) => {
      const timerId = setInterval(() => {
        date = new Date();
        update(self);
      }, 1000);

      return () => clearInterval(timerId);
    }}
  >
    <svg viewBox="-50 -50 100 100">
      <circle class="face" r="48" />
      <line
        class="hour"
        transform={() =>
          `rotate(${30 * (date.getHours() % 12) + date.getMinutes() / 2})`
        }
        y2="-25"
      />
      <line
        class="minute"
        transform={() => `rotate(${6 * date.getMinutes()})`}
        y2="-35"
      />
      <line
        class="second"
        transform={() => `rotate(${6 * date.getSeconds()})`}
        y2="-35"
      />
    </svg>
  </div>
);

Made with Fusor library

4 Comments
2024/10/12
08:49 UTC

11

Dweet of the Week: untitled by Hardly Productive

1 Comment
2024/10/11
15:27 UTC

Back To Top