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 / 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 / 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 } }
@srdjan
srdjan / FlowTutorial.js
Last active October 3, 2017 14:04 — forked from busypeoples/FlowTutorial.js
Flow Fundamentals For JavaScript Developers
// @flow
// Flow Fundamentals For JavaScript Developers
/*
Tutorial for JavaScript Developers wanting to get started with FlowType.
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.
@srdjan
srdjan / _about.md
Created September 15, 2017 18:31 — forked from sgoguen/_about.md
A Small Elm-like DSL in F#

Making Toys with F# - A Small Elm-like DSL in F#

A Small Elm-Like DSL in F#

I've been working on a talk about the virtues of building toy examples for the purpose of communicating ideas with simple interactive examples.

The toys I talk about in my presentation are based my interest in tools that allow programmers to quickly build web applications that allow them to explore their architecture. So to kickstart this series off, I want to introduce a simple