Skip to content

Instantly share code, notes, and snippets.


Peter Lyons focusaurus

View GitHub Profile
focusaurus / gist:03b814ea78e3952749dd
Created Jun 26, 2015
DB integrity checker instructions
View gist:03b814ea78e3952749dd

Hi friend! So I just put up an alpha of my data analyzer that can scan any mongodb or couchdb server you can access from your laptop (including your local dev ones). It works by ssh tunneling and the "UI" is all ssh.

Could you give it a try and see what it says about your data?

Here's how to run it:

  1. ssh
  • use password "password" when prompted
  1. Answer the questions about your db server it asks you
  • it will print another longer ssh command
focusaurus /
Created Sep 17, 2015
using the "comcast" utility to throttle network traffic to a specific application
# In this example, the application I want to throttle is on TCP port 9110
throttle() {
local profile="${1-wifi}"
local bandwidth=30000
local latency=40
focusaurus / .babelrc
Created Jan 28, 2016
iron-node and babel step through
View .babelrc
"presets": ["es2015", "stage-0"],
"plugins": [
View promises-are-always-async.js
// outputs:
// bar
// foo
View functional web framework
function listUsers (req, callback) {
// use req as immutable input
// standard node error-first callback API
// success value of callback is a response-shaped object with properties: statusCode, headers, body
// I haven't built one of these, just riffing.
// Look at clojure and other functional languages for examples that might
// have reasonable counterparts in "functional-light" JS
// Thinking more along the lines of react/redux reducer style
focusaurus / package.json
Created Oct 10, 2016
atom-format-shell package.json
View package.json
"activationHooks": [
"author": "Peter Lyons <> (",
"bugs": {
"url": ""
"configSchema": {
"shfmtPath": {
focusaurus / sign-in.elm
Last active Nov 7, 2016
How to handle Http POST
View sign-in.elm
module SignIn exposing (..)
import Html exposing (..)
import Html.App
import Http
import Json.Decode
import Task
type alias Model =
focusaurus / A.elm
Created Dec 5, 2016
Decode JSON string enum into elm union type
View A.elm
module A exposing (..)
import Json.Decode as JD
import Json.Encode as JE
type alias User =
{ id : Int
, theme : Theme
focusaurus / A.elm
Created Dec 14, 2016
Trying to handle blur event and get at as a String
View A.elm
module A exposing (..)
import Debug
import Html
import Html exposing (..)
import Html.Attributes exposing (..)
import Html.Events exposing (onBlur, onClick, on)
import Json.Decode as JD
import Json.Encode as JE
View WebDataPagination.elm
module Lab.WebDataPagination exposing (main)
import Html exposing (..)
import RemoteData as RD
import Json.Decode as JD
import Http
-- import Html.Attributes exposing (..)
You can’t perform that action at this time.