Skip to content

Instantly share code, notes, and snippets.

View srdjan's full-sized avatar

⊣˚∆˚⊢ srdjan

View GitHub Profile
@srdjan
srdjan / index.html
Created March 23, 2024 14:43
Status Board
<dashboard class="dashboard">
<dashboard-header title="Datacenter">
<dashboard-clock digital="true" binary="true" />
</dashboard-header>
<server-list>
<server v-for="(server, index) in servers" :class="{ 'has-failed': !server.status }" :type="server.type" @click.native="updateServerStatus(index)">
<span slot="name" class="data">{{server.name}}</span>
<span slot="status" class="data signal">{{server.status ? 'ONLINE' : 'OFFLINE'}}</span>
<span slot="adr" class="data">{{server.adr}}</span>
</server>
@srdjan
srdjan / 100+ different counter apps...
Last active February 19, 2024 22:41
100+ different js counter apps...
100+ different js counter apps...
@srdjan
srdjan / test.md
Created January 10, 2023 23:56 — forked from ityonemo/test.md
Zig in 30 minutes

A half-hour to learn Zig

This is inspired by https://fasterthanli.me/blog/2020/a-half-hour-to-learn-rust/

Basics

the command zig run my_code.zig will compile and immediately run your Zig program. Each of these cells contains a zig program that you can try to run (some of them contain compile-time errors that you can comment out to play with)

@srdjan
srdjan / ct_notes.txt
Created December 30, 2016 16:57 — forked from buzzdecafe/ct_notes.txt
Category Theory for Programmers: Notes
CATEGORY THEORY FOR PROGRAMMERS
Category Theory 1.1: Motivation and Philosophy
https://www.youtube.com/watch?v=I8LbkfSSR58&index=1&list=PLbgaMIhjbmEnaH_LTkxLI7FMa2HsnawM_
Composability, Abstraction, Reusability
Category Theory is a higher-level language.
Not a practical, executable language.
@srdjan
srdjan / recursion.ts
Created April 5, 2020 16:37 — forked from mikearnaldi/recursion.ts
Recursion schemes in TS
import { Functor1 } from "fp-ts/lib/Functor";
import { URIS, Kind } from "fp-ts/lib/HKT";
import { pipeable } from "fp-ts/lib/pipeable";
import { flow } from "fp-ts/lib/function";
interface Algebra<F extends URIS, A> {
(_: Kind<F, A>): A;
}
interface Fix<F extends URIS> {
@srdjan
srdjan / plink-plonk.js
Created February 15, 2020 21:37 — forked from tomhicks/plink-plonk.js
Listen to your web pages
@srdjan
srdjan / k3s-multipass.sh
Created January 12, 2020 13:36 — forked from lucj/k3s-multipass.sh
Setup a k3s kubernetes cluster using Multipass VMs
for node in node1 node2 node3;do
multipass launch -n $node
done
# Init cluster on node1
multipass exec node1 -- bash -c "curl -sfL https://get.k3s.io | sh -"
# Get node1's IP
IP=$(multipass info node1 | grep IPv4 | awk '{print $2}')
@srdjan
srdjan / IMyProtocol.d.ts
Created March 5, 2019 19:17 — forked from elierotenberg/IMyProtocol.d.ts
Statically typechecked serializable protocol
import { IProtocol, IRequestResponseMap, IEventMap } from "./IProtocol";
import { ISerializable } from "./ISerializable";
type RequestResponseMap = {
ping: {
RequestParams: {};
ResponseParams: {};
};
echo: {
RequestParams: ISerializable;
@srdjan
srdjan / TypeScriptFundamentals.ts
Created March 3, 2019 19:15 — forked from busypeoples/TypeScriptFundamentals.ts
TypeScript Fundamentals For JavaScript Developers
// TypeScript Fundamentals For JavaScript Developers
/*
Tutorial for JavaScript Developers wanting to get started with TypeScript.
Thorough walkthrough of all the basic features.
We will go through the basic features to gain a better understanding of the fundamentals.
You can uncomment the features one by one and work through this tutorial.
If you have any questions or feedback please connect via Twitter:
A. Sharif : https://twitter.com/sharifsbeat
*/
type JSValue = { kind: 'JSNull' }
| { kind: 'JSBool', value: boolean }
| { kind: 'JSString', value: string }
| { kind: 'JSRational', asFloat: boolean, value: number }
| { kind: 'JSArray', value: JSValue[] }
| { kind: 'JSObject', value: { [key: string]: JSValue } }