Skip to content

Instantly share code, notes, and snippets.

@shamrin
shamrin / 0README.md
Last active Mar 29, 2020
Install OsmoNITB with SMPP
View 0README.md

Quick Osmocom OpenBSC installation

Prerequisites

  • Ubuntu Trusty (previous LTS and in between versions should work too)
  • sudo apt-get install gcc make git autoconf libtool pkg-config build-essential automake libortp-dev python libsqlite3-dev

Installing

@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!"]
@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
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 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 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 / 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