Skip to content

Instantly share code, notes, and snippets.

View mika76's full-sized avatar
🤖
Coding...

Mladen Mihajlović mika76

🤖
Coding...
  • Serbia
  • 14:01 (UTC +02:00)
View GitHub Profile
@pakLebah
pakLebah / fancyInput.pas
Last active October 2, 2024 13:18
Fancy input for console program.
program fancyInput;
(*****************************************************************************
This program demonstrates fancy input mechanism for console application by
simply using CRT unit. For example selecting an item from a drop down menu,
length-limited phone number input, and yes/no input. Hopefully, new Pascal
beginners will learn something from this sample program. Thank you. :)
//! WARNING! This program requires FPC v3.2+ with compiler option -S2chij-
// create a bookmark and use this code as the URL, you can now toggle the css on/off
// thanks+credit: https://dev.to/gajus/my-favorite-css-hack-32g3
javascript: (function() {
var domStyle = document.createElement("style");
domStyle.append(
'* { color:#0f0!important;outline:solid #f00 1px!important; background-color: rgba(255,0,0,.2) !important; }\
* * { background-color: rgba(0,255,0,.2) !important; }\
* * * { background-color: rgba(0,0,255,.2) !important; }\
* * * * { background-color: rgba(255,0,255,.2) !important; }\
* * * * * { background-color: rgba(0,255,255,.2) !important; }\
@balvinder294
balvinder294 / zabbix-docker-compose.yml
Created July 11, 2019 11:39
Zabbix running in Docker Compose with Postgres, Graffana, Adminer
version: '3.1'
services:
postgres-server: # The Postgres Database Service
image: postgres:latest
restart: always
environment: # Username, password and database name variables
POSTGRES_USER: zabbix
POSTGRES_PASSWORD: zabbix
POSTGRES_DB: zabbix
PG_DATA: /var/lib/postgresql/data/pgdata #data storage
@fatcerberus
fatcerberus / monads4all.md
Last active June 11, 2025 11:22
Monads for the Rest of Us

Monads for the Rest of Us

by Bruce Pascoe - 1 May, 2019

"A monad is just a monoid in the category of endofunctors. What's the problem?" ~James Iry[^1]

The problem... is that there are several problems.

It's been said that monads bear a dreadful curse. Once you finally understand what they are, you begin to see them everywhere--but somehow become completely incapable of explaining them to anyone else. Many tutorial writers have tried to break the Great Curse--the Web is lousy with bold attempts and half successes that attest to this--and just as many have failed. Well, I'm here to address the elephant in the room[^2] and tell you that I intend to break the Great Curse once and for all.

There are basically two ways a monad tutorial tends to go. One is a paragraph or two of minimal descriptions of one or two common monads (Haskell's Maybe in particular is very popular), followed by a lot of intimidating Haskell syntax trying to explain--precisely--how it all fits together. This is well

@Liquidream
Liquidream / p8pathfinder-edit.p8
Created March 12, 2019 14:27
Pathfinder... with diagonals?
-- returns any neighbor map
-- position at which flag zero
-- is unset
function map_neighbors(node, graph)
local neighbors = {}
if (not fget(mget(node.x - 1, node.y - 1), 0)) add(neighbors, {x=node.x - 1, y=node.y - 1})
if (not fget(mget(node.x, node.y - 1), 0)) add(neighbors, {x=node.x, y=node.y - 1})
if (not fget(mget(node.x + 1, node.y - 1), 0)) add(neighbors, {x=node.x + 1, y=node.y - 1})
if (not fget(mget(node.x - 1, node.y), 0)) add(neighbors, {x=node.x - 1, y=node.y})
if (not fget(mget(node.x + 1, node.y), 0)) add(neighbors, {x=node.x + 1, y=node.y})
@leereilly
leereilly / PICO-8.TXT
Created December 17, 2018 21:11
PICO-8 docs
PICO-8 v0.1.11g
https://www.pico-8.com
(c) Copyright 2014-2018 Lexaloffle Games LLP
Author: Joseph White // <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="f8909d81b8949d809994979e9e949dd69b9795">[email&#160;protected]</a>
PICO-8 is built with:
SDL2 http://www.libsdl.org
Lua 5.2 http://www.lua.org // see license.txt
GIFLIB http://giflib.sourceforge.net/
WiringPi http://wiringpi.com/
@TrillCyborg
TrillCyborg / mastodon-docker-setup.md
Last active July 23, 2025 11:08
Mastodon Docker Setup

Mastodon Docker Setup

Setting up

Clone Mastodon's repository.

# Clone mastodon to ~/live directory
git clone https://github.com/tootsuite/mastodon.git live
# Change directory to ~/live

cd ~/live

@pakLebah
pakLebah / ansiCRT.pas
Last active October 2, 2024 13:15
ANSI code unit and demo program using Free Pascal.
unit ansiCRT;
(******************************************************************************
This unit is emulating classic Pascal's CRT unit text color management and
cursor movement using ANSI Escape Code sequence. Keyboard input handling &
screen windowing is not possible. For keyboard input, better use the FPC's
Keyboard unit.
ANSI Escape Code list taken from:
https://en.wikipedia.org/wiki/ANSI_escape_code
@MarcAlx
MarcAlx / RandomNumberGenerator.cs
Created July 8, 2018 09:53
Mersenne Twister - C#
/// <summary>
/// Random Number Generator based on Mersenne-Twister algorithm
///
/// Usage :
/// RandomNumberGenerator.Instance.Generate());
/// RandomNumberGenerator.Instance.Generate(1.1,2.2);
/// RandomNumberGenerator.Instance.Generate(1,100)
///
/// inspired from : http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/VERSIONS/C-LANG/980409/mt19937-2.c
/// </summary>
@Tomassito
Tomassito / download-file.js
Last active March 11, 2022 23:53 — forked from javilobo8/download-file.js
Download files with AJAX (axios)
axios({
url: 'http://localhost:5000/static/example.pdf',
method: 'GET',
responseType: 'blob', // important
}).then((response) => {
const url = window.URL.createObjectURL(new Blob([response.data]));
const link = document.createElement('a');
link.href = url;
link.setAttribute('download', 'file.pdf');
link.click();