Skip to content

Instantly share code, notes, and snippets.

Risto Stevcev Risto-Stevcev

Block or report user

Report or block Risto-Stevcev

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@Risto-Stevcev
Risto-Stevcev / Frontend.ml
Last active Oct 14, 2019
Tree shaking only for bs-declaredom
View Frontend.ml
let _ = Js.log "hello world!"
let x =
let open RistostevcevBsDeclaredom.Html in
div [|text "foobar"|]
let _ =
if Js.Option.isSome HotModuleReload.module_hot then
let _ = HotModuleReload.on_accept @@ fun () -> Js.log "accept: reloading..."
and _ = HotModuleReload.on_dispose @@ fun () -> Js.log "dispose: reloading..."
@Risto-Stevcev
Risto-Stevcev / Frontend.ml
Last active Oct 14, 2019
Attempt at tree shaking and code splitting combo for bs-declaredom
View Frontend.ml
let _ = Js.log "hello world!"
let x =
let open RistostevcevBsDeclaredom.Html in
div [|text "foobar"|]
let _ =
if Js.Option.isSome HotModuleReload.module_hot then
let _ = HotModuleReload.on_accept @@ fun () -> Js.log "accept: reloading..."
and _ = HotModuleReload.on_dispose @@ fun () -> Js.log "dispose: reloading..."
View config
# This file has been auto-generated by i3-config-wizard(1).
# It will not be overwritten, so edit it as you like.
#
# Should you change your keyboard layout some time, delete
# this file and re-run i3-config-wizard(1).
#
# i3 config file (v4)
#
# Please see https://i3wm.org/docs/userguide.html for a complete reference!
View disassembler.erl
-module(disassembler).
-export([disassemble/0]).
disassemble() ->
compile:file('hello.erl', ['S']).
@Risto-Stevcev
Risto-Stevcev / hello.ll
Last active Jul 15, 2019
LLVM hello world
View hello.ll
; To emit LLVM from C code (for discovery):
; clang -emit-llvm -S hello.c -o hello.ll
; Declare the printf function
declare i32 @printf(i8*, ...)
@.str = private unnamed_addr constant [14 x i8] c"hello world!\0A\00"
define i32 @main() noinline optnone {
call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i32 0, i32 0))
@Risto-Stevcev
Risto-Stevcev / categories.hs
Created Mar 13, 2019 — forked from texastoland/categories.hs
Is everything just a monoid in the category of something?
View categories.hs
(.) :: (b -> c) -> (a -> b) -> (a -> c) -- functions
(.) :: cat b c -> cat a b -> cat a c -- categories
(++) :: String -> String -> String -- strings
(<>) :: a -> a -> a -- monoids
(<>) :: cat a a -> cat a a -> a a -- categories
(++) :: [a] -> [a] -> [a] -- lists
(<|>) :: f a -> f a -> f a -- alternatives
(<|>) :: cat a a -> cat a a -> a a -- categories
@Risto-Stevcev
Risto-Stevcev / gitvim.sh
Created Dec 28, 2018
This script opens changed files from git into neovim
View gitvim.sh
#!/bin/bash
# This script opens changed files from git into neovim
FOR_STATUS=
FOR_LOG=
COMMIT="HEAD"
open_in_vim () {
if [[ ! -z $FOR_LOG ]]; then
git show --pretty="" --name-only $COMMIT | xargs nvim -p
@Risto-Stevcev
Risto-Stevcev / odoc.sh
Last active Oct 29, 2018
Helper shell script to run odoc for bucklescript projects
View odoc.sh
#!/bin/bash
readonly PKG_NAME_RE='.*\"name\":\s*"\(.*\)".*'
readonly PKG_NAME=$(
cat bsconfig.json \
| grep "\"name\":" \
| sed -e 's/'"${PKG_NAME_RE}"'/\1/g'
)
readonly DOCS=${1:-docs}
@Risto-Stevcev
Risto-Stevcev / test.ml
Created Jul 31, 2018 — forked from infinity0/test.ml
OCaml GADTs and avoiding "type constructor would escape its scope" errors
View test.ml
(* GADT list that exposes the type of the head element *)
type _ hlist =
| Nil: 'a hlist
| Cons: ('a * 'b hlist) -> 'a hlist
(* let rec len = function *)
(* let rec len (type a) (l: a hlist): int = match l with *)
(* both of the above result in a "type constructor would escape its scope" error *)
(* correct version: *)
let rec len : type a. a hlist -> int = function
@Risto-Stevcev
Risto-Stevcev / what-forces-layout.md
Created Jun 22, 2018 — forked from paulirish/what-forces-layout.md
What forces layout/reflow. The comprehensive list.
View what-forces-layout.md

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Element

Box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
  • elem.clientLeft, elem.clientTop, elem.clientWidth, elem.clientHeight
  • elem.getClientRects(), elem.getBoundingClientRect()
You can’t perform that action at this time.