{{ message }}

Instantly share code, notes, and snippets.

👑

Danil Yarantsev Yardanico

👑
Created Jan 18, 2021
View keybase.md

Keybase proof

I hereby claim:

• I am yardanico on github.
• I am yardanico (https://keybase.io/yardanico) on keybase.
• I have a public key ASABgQ-ZQySEjIEtP37kA5Teo7TRQWw6UQ5i_Dk8wZ_JFAo

To claim this, I am signing this object:

Created May 17, 2020 — forked from curran/.block
Compare Colors
View .block
Created Jan 27, 2020
View bench.nim
 import mathexpr import std / [times, monotimes, stats] var r: RunningStat for iterations in 1..5: let start = getMonoTime() let e = newEvaluator() for i in 0 ..< 1000000: let r = e.eval("100^---+-++---++-+-+-.5+1 + --(1e2^(+(-(-(-.5e0))))+1e0)")
Last active Jan 25, 2020
FizzBuzz in v's and fizzbuzz
View fulllib.nim
 import macros, strutils, sequtils, sugar var bytes {.compileTime.}: seq[int] const chars = ["fizz", "buzz", "fizzbuzz"] proc translate(): string = for i in 0..<(bytes.len div 7): result.add( chr( 100*bytes[7*i] +
Last active Sep 8, 2019
View main.zig
 const c = @cImport({ @cInclude("string.h"); @cInclude("stdio.h"); @cInclude("ui.h"); }); extern fn onClosing(w: ?*c.uiWindow, data: ?*c_void) c_int { c.uiQuit(); return 1; }
Last active Feb 3, 2019
View simple_log.nim
 import strutils, times, terminal, macros export strutils.format type LogLevel* = enum lvlDebug = "DEBUG" lvlInfo = "INFO" lvlNotice = "NOTICE" lvlWarn = "WARN" lvlError = "ERROR"
Created Jun 16, 2018
Fixed issues
View main.md

This is a document containing all fixed (in current devel) but not yet closed issues from nim-lang/Nim repository. Most of the issues can't be closed immediately because they require a test-case, that's why I created this document.

Created Jun 10, 2018
View mathexpr_parse.nim
 import math, strutils, parseutils, strformat type MathFunction = proc(args: seq[float]): float NodeKind = enum Num, Mul, Div, Mod, Pow, Add, Sub, UnarySub, UnaryAdd, Fun, Var Node = ref object case kind: NodeKind
Last active Apr 2, 2018 — forked from diegogub/json_case_parse.nim
View json_case_parse.nim
 import macros, json type Event = ref object of RootObj id: string type TestMade = ref object of Event name: string type Test = ref object of Event
Last active May 6, 2018
View scheduling.nim
 import asyncdispatch template scheduleCall(ms: int, oneshot: bool, call: untyped) = # We use `block` here because we can't use gensym with async block: proc sched() {.async.} = await sleepAsync(ms) await call if not oneshot: # We don't use await here because otherwise every sched() call