Skip to content

Instantly share code, notes, and snippets.

Nickolay Kolev nmk

Block or report user

Report or block nmk

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
View SelectionTest.hs
#!/usr/bin/env stack
-- stack --resolver lts-11.15 script --package text --package yesod
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeFamilies #-}
View SelectionTest.hs
#!/usr/bin/env stack
-- stack --resolver lts-11.15 script --package text --package yesod
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeFamilies #-}
View Main.elm
module Main exposing (..)
import Form exposing (..)
import Form.Input as Input
import Form.Validate exposing (..)
import Html exposing (..)
type Color
= Red
@nmk
nmk / Main.elm
Last active Oct 22, 2016
Dependent fields validation with elm-simple-form
View Main.elm
module Main exposing (..)
import Form exposing (Form, FieldState)
import Form.Input as Input
import Form.Validate exposing (..)
import Html exposing (..)
import Html.App as Html
import Html.Attributes exposing (..)
@nmk
nmk / gist:ed115b30480a30cc917c
Created Feb 17, 2016
Bad Vector dropWhile performance Core
View gist:ed115b30480a30cc917c
==================== Tidy Core ====================
2016-02-17 18:20:25.680333 UTC
Result size of Tidy Core = {terms: 869, types: 656, coercions: 162}
lvl_rdKT
lvl_rdKT =
case $wshowSignedInt 0 10000000 ([])
of _ { (# ww5_a93C, ww6_a93D #) ->
View gist:4c46280479419ca899b1
Debugger entered--Lisp error: (void-function projectile-project-p)
(projectile-project-p)
(if (projectile-project-p) (cons (abbreviate-file-name (projectile-project-root)) (projectile-relevant-known-projects)) projectile-known-projects)
(lambda nil (if (projectile-project-p) (cons (abbreviate-file-name (projectile-project-root)) (projectile-relevant-known-projects)) projectile-known-projects))()
#[0 "\301\302\303\300!\203
\300 \202\300\"\207" [(lambda nil (if (projectile-project-p) (cons (abbreviate-file-name (projectile-project-root)) (projectile-relevant-known-projects)) projectile-known-projects)) helm-init-candidates-in-buffer global functionp] 4 "\n\n(fn)"]()
apply(#[0 "\301\302\303\300!\203
\300 \202\300\"\207" [(lambda nil (if (projectile-project-p) (cons (abbreviate-file-name (projectile-project-root)) (projectile-relevant-known-projects)) projectile-known-projects)) helm-init-candidates-in-buffer global functionp] 4 "\n\n(fn)"] nil)
helm-funcall-with-source(((name . "*Helm Switch Pr
View gist:64ad901d7d237a7be925
dtrace: error on enabled probe ID 5 (ID 161: syscall::open:return): invalid user access in action #11 at DIF offset 24
dtrace: error on enabled probe ID 5 (ID 161: syscall::open:return): invalid user access in action #11 at DIF offset 24
dtrace: error on enabled probe ID 5 (ID 161: syscall::open:return): invalid user access in action #11 at DIF offset 24
dtrace: error on enabled probe ID 5 (ID 161: syscall::open:return): invalid user access in action #11 at DIF offset 24
dtrace: error on enabled probe ID 5 (ID 161: syscall::open:return): invalid user access in action #11 at DIF offset 24
dtrace: error on enabled probe ID 5 (ID 161: syscall::open:return): invalid user access in action #11 at DIF offset 24
dtrace: error on enabled probe ID 5 (ID 161: syscall::open:return): invalid user access in action #11 at DIF offset 24
dtrace: error on enabled probe ID 5 (ID 161: syscall::open:return): invalid user access in action #11 at DIF offset 24
dtrace: error on enabled probe ID 5 (ID 161: syscall::open:return): inva
@nmk
nmk / gist:75c7ba95917608ba8c69
Last active Sep 3, 2015
Stack ghci fails to load Prelude
View gist:75c7ba95917608ba8c69
haskell $ stack new foobar
Downloading template "new-template" to create project "foobar" in foobar/ ...
The following parameters were needed by the template but not provided: author-email, author-name, category, copyright, github-username
You can provide them in /Users/nmk/.stack/stack.yaml, like this:
templates:
params:
author-email: value
author-name: value
category: value
copyright: value
View running_stat.rb
require "minitest/autorun"
class RunningStat
def initialize(opts={})
@nr_of_els = opts.fetch(:nr_of_els, 0)
@old_m = opts.fetch(:old_m, 0.0)
@old_s = opts.fetch(:old_s, 0.0)
end
def push(x)
View foo.rb
class Foo
attr_accessor :n
def initialize(i)
@n = i
end
def val
n
end
You can’t perform that action at this time.