Skip to content

Instantly share code, notes, and snippets.

Peter Lyons focusaurus

Block or report user

Report or block focusaurus

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
@focusaurus
focusaurus / notes.md
Last active Oct 23, 2017
node --inspect bugs
View notes.md

Call Stack Expanding: Summary

When debugging node.js via devtools and --inspect, the devtools "Call Stack" accordian panel expands automatically, forcing the "Scope" panel out of the viewable area.

Versions

  • macOS 10.13
  • node v6.11.4, node v6.11.3
  • Chrome 62.0.3202.62, Chrome 61.0.3163.100
@focusaurus
focusaurus / notes.md
Last active Oct 17, 2017
Regular Expression Registry
View notes.md

What

A registry of regular expressions

Base Data

  • The expression string
  • taxonomy/category
  • supported engines
  • a set of test inputs
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 (..)
@focusaurus
focusaurus / build.sh
Last active Jun 5, 2017
markdown slides with reveal build snippet
View build.sh
#!/usr/bin/env bash
base_build() {
build_dir="./build"
mkdir -p "${build_dir}"
# OSX build support. BSD tar vs GNU tar issue
if [[ "$(uname)" == "Darwin" ]]; then
alias tar=gtar
fi
# This takes all files that have been at least added to git
@focusaurus
focusaurus / build.sh
Created Jan 26, 2017
Build script detects macOS and runs itself under docker
View build.sh
#!/usr/bin/env bash
cd "$(dirname "$0")/.."
if [[ "$(uname)" == "Darwin" ]]; then
docker build --tag foo-rpmbuild .
docker run --interactive --tty --rm \
--volume "${PWD}:/opt/docker-host" \
--volume "$(yarn cache dir | grep '^/'):/var/run/yarn-cache" \
foo-rpmbuild /opt/docker-host/bin/build.sh
exit
@focusaurus
focusaurus / A.elm
Created Dec 14, 2016
Trying to handle blur event and get at event.target.textContent 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
@focusaurus
focusaurus / chai_reference.js
Last active Nov 18, 2016
Quick reference for the chaijs.com assertion library
View chai_reference.js
/*
run this JavaScript on the chai API doc page:
console.log([].map.call(document.querySelectorAll('div.api_method_wrapper h3'), (x) => x.innerText).join('\n'))
*/
assert(expression, message)
.fail(actual, expected, [message], [operator])
.isOk(object, [message])
.isNotOk(object, [message])
@focusaurus
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
focusaurus / package.json
Created Oct 10, 2016
atom-format-shell package.json
View package.json
{
"activationHooks": [
"language-shellscript:grammar-used"
],
"author": "Peter Lyons <pete@peterlyons.com> (http://peterlyons.com)",
"bugs": {
"url": "https://github.com/focusaurus/atom-format-shell/issues"
},
"configSchema": {
"shfmtPath": {
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
You can’t perform that action at this time.