Susan Potter

Code snippets and technical notes

snippets: Created / Updated

JavaScript Performance: Node CLI flags

These are some notes on performance engineering related to generating insights into Node.js (v8) performance. All material here is specific to the v8 engine found in Node.js, Chrome, and Opera. Generally useful things to learn to tune JavaScript (for the v8 engine) is natives syntax. You can run JS with natives syntax directives sprinkled throughout using …

snippets: Created / Updated

Socket Statistics on Linux with ss

An excellent tool when you need to troubleshoot distributed systems is ss, which provides visibility into TCP states of your live connections. Even if you know netstat this is a command you should get acquainted with because of its more powerful interface which requires fewer pipes to find the connection information you need and it is probably already …

    snippets: Created / Updated

    Profunctor exploration in less than 100 lines of Haskell

    A snippet showing the design space around profunctors using Haskell as the teaching language Includes sighting of Strong, Choice, Cartesian and more profunctors.

    snippets: Created / Updated

    Decoding lens operators

    Notation conventions The following table provides a quick overview of conventions used in symbolic operators in the lens library. Symbol Concept Denotes ^ getter gets value from structure ~ setter sets values in structure % over apply transformation over selected substructure = state threads state through << before change returns value before …

      snippets: Created / Updated

      Ruby 2.4 changes overview

      Unified Fixnum and Bignum into Integer It’s backward compatible too. $ irb irb(main):001:0> RUBY_VERSION => "2.3.1" irb(main):002:0> (2**100).class => Bignum irb(main):003:0> 2.class => Fixnum irb(main):004:0> Fixnum => Fixnum irb(main):005:0> Bignum => Bignum irb(main):006:0> Bogonum NameError: uninitialized …

      snippets: Created / Updated

      Nix in your home directory

      Prerequisites wget is installed tar is installed Purpose If you really don't want to install Nix under /nix (or you can't) then you can install Nix in your home directory like in the homedir_install.sh script included in this Gist. Now whenever you want to run a command under Nix's control, you should prefix with nixrun. Good luck. …

        snippets: Created / Updated

        Scala WTFs - moments of confusion in the Scala REPL

        Small sample of Scala WTFs circa 2014 from the REPL (many taken from Paul Phillips talks on the Scala Collections library): scala> List("a", "b", "c").toSet // the only reasonable line of code in here res1: scala.collection.immutable.Set[String] = Set(a, b, c) scala> List("a", "b", "c").toSet() // seen …

        snippets: Created / Updated

        OSX Lion (10.7.4) work laptop setup

        Homebrew Install after the command-line tools for Xcode. tmux erlang haskell-platform zsh git figlet scala sbt rbenv ruby-build s3cmd pit brew install tmux erlang haskell-platform zsh \ git figlet scala sbt rbenv ruby-build s3cmd pit RubyGems veewee App Store Opera Skitch XCode (Command-line tools) Miro (if only there was a way to uninstall iTunes) Manual …

          snippets: Created / Updated

          Erlang OTP Glossary of Terms

          I am hoping this will serve as a reference for coworkers and others new to Erlang and OTP to be able to figure out the terminology easier than I had to. I learned the hard way, so you don't have to!:) Erlang/OTP - The set of libraries and conventions that are used as part of the core Erlang distribution by Ericsson to build fault-tolerant, distributed …

          snippets: Created / Updated

          Erlang Meck API notes

          Here is a snippet showing how to use the Meck API which is a mocking library in Erlang. We will show how to create a fully mocked version of an existing module, unloading mocks, removing functions from a mocked module, and getting a list of all function calls to a module.