Skip to content

Instantly share code, notes, and snippets.

Alexey Shamrin shamrin

Block or report user

Report or block shamrin

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 todomvc-compact.eve-error.log
$ build/lueve -e examples/todomvc-compact.eve
-----ERROR----
DependencyGraph{
1: #{ } -> #{ variable<object-13-31>, variable<todo>}
object{binding{ENTITY -> variable<object-13-31>}, binding{tag -> todo-item}, binding{todo -> variable<todo>}, }
2: #{ }|ANY:#{ variable<todo>} -> #{ variable<todo>}
expression =(a = variable<todo>, b = variable<todo>)
3: #{ }|ANY:#{ variable<object-13-67>, variable<todo>} -> #{ variable<todo>, variable<object-13-67>}
expression =(a = variable<todo>, b = variable<object-13-67>)
4: #{ } -> #{ variable<object-13-31>, variable<object-13-7>}
View no-controlled-components.elm
import Html exposing (Html, Attribute, text, div, input)
import Html.App exposing (beginnerProgram)
import Html.Attributes exposing (..)
import Html.Events exposing (onInput, on)
import String
main =
beginnerProgram { model = "", view = view, update = update }
View elm017-key-bug.elm
import Html exposing (Html, Attribute, text, div, input, button)
import Html.App exposing (beginnerProgram)
import Html.Attributes exposing (..)
import Html.Events exposing (onInput, onClick)
import String
main =
beginnerProgram { model = ["", "", ""], view = view, update = update }
View sam-safe.md
$ git clone https://github.com/jdubray/sam-safe
$ npm install
npm WARN Invalid name: "sam-safe middleware with blog sample harness"
…
$ # Edit package.json, changing the name field to "sam-safe" in package.json (my npm doesn't like spaces)
$ npm install
$ npm start
> sam-safe@1.0.0 start /Users/user/src/sam-safe
> node server-model.js
@shamrin
shamrin / ffmerge
Last active Dec 9, 2016
ffmerge and ffrebase: merge in fast-forward-only single-commit workflow
View ffmerge
#!/usr/bin/env fish
set branch (git symbolic-ref -q --short HEAD)
or exit 1
if test $branch = "master"
echo "error: can't ffmerge master to master, switch to feature branch first"
exit 2
end
View Group with counts.md
module Group where

import List.Extra exposing (span)

countingGroupBy : (a -> b) -> List a -> List (b, Int)
countingGroupBy key xs' =
  let
    eq a b = key a == key b
@shamrin
shamrin / SuperTimer.elm
Last active Feb 14, 2016
Restartable timer
View SuperTimer.elm
module SuperTimer where
import Html exposing (..)
import Html.Events exposing (onClick)
import Time exposing (Time)
import Signal exposing (Address)
type Action = Tick Time | Toggle Bool
type alias Model = { running: Bool, count: Float}
View gist:249628d867d955133987
$ curl -s https://raw.githubusercontent.com/twitter/twitter-text/master/js/twitter-text.js | uglifyjs | gzip | wc -c
14988
$ curl -s https://raw.githubusercontent.com/twitter/twitter-text/master/js/twitter-text.js | uglifyjs | wc -c
40295
$ curl -s https://raw.githubusercontent.com/twitter/twitter-text/master/js/twitter-text.js | gzip | wc -c
19747
$ curl -s https://raw.githubusercontent.com/twitter/twitter-text/master/js/twitter-text.js | wc -c
62616
@shamrin
shamrin / First.elm
Last active Apr 7, 2017
Multiple Elm main modules
View First.elm
module First where
import Html exposing (span, text)
main = span [ ] [text "Hello First!"]
View Geolocation accuracy.md

Geolocation accuracy

Summary of the API major platforms provide regarding geolocation and its accuracy.

Platform Coordinates accuracy Altitude accuracy Confidence interval Invalid value
Web Coordinates.accuracy Coordinates.altitudeAccuracy 95% null (but coordinates accuracy is always available)
Android getAccuracy() no 68% 0.0
iOS horizontalAccuracy verticalAccuracy not defined < 0
You can’t perform that action at this time.