Skip to content

Instantly share code, notes, and snippets.

View johnhaley81's full-sized avatar

John Haley johnhaley81

View GitHub Profile
@johnhaley81
johnhaley81 / gdb-backlog
Created January 6, 2016 15:42
Backlog of breaking nodegit prebuilt. Run on Ubuntu 14.04 AMD Opteron 64-bit VM
Program terminated with signal SIGILL, Illegal instruction.
#0 0x00007fffe75b951c in lh_new ()
from /home/qa/Downloads/GitKrakenBreaking/resources/app.asar.unpacked/node_modules/nodegit/build/Release/nodegit.node
#1 0x00007fffe75a8781 in int_err_get ()
from /home/qa/Downloads/GitKrakenBreaking/resources/app.asar.unpacked/node_modules/nodegit/build/Release/nodegit.node
#2 0x00007fffe75a8966 in int_err_set_item ()
from /home/qa/Downloads/GitKrakenBreaking/resources/app.asar.unpacked/node_modules/nodegit/build/Release/nodegit.node
#3 0x00007fffe75a6bcd in ERR_load_ERR_strings ()
from /home/qa/Downloads/GitKrakenBreaking/resources/app.asar.unpacked/node_modules/nodegit/build/Release/nodegit.node
#4 0x00007fffe75a8fc9 in ERR_load_crypto_strings ()
#0 0x00007fc83ef3851c in lh_new () from /home/qa/Downloads/GitKraken/resources/app.asar.unpacked/node_modules/nodegit/build/Release/nodegit.node
#1 0x00007fc83ef27781 in int_err_get () from /home/qa/Downloads/GitKraken/resources/app.asar.unpacked/node_modules/nodegit/build/Release/nodegit.node
#2 0x00007fc83ef27966 in int_err_set_item () from /home/qa/Downloads/GitKraken/resources/app.asar.unpacked/node_modules/nodegit/build/Release/nodegit.node
#3 0x00007fc83ef25bcd in ERR_load_ERR_strings () from /home/qa/Downloads/GitKraken/resources/app.asar.unpacked/node_modules/nodegit/build/Release/nodegit.node
#4 0x00007fc83ef27fc9 in ERR_load_crypto_strings () from /home/qa/Downloads/GitKraken/resources/app.asar.unpacked/node_modules/nodegit/build/Release/nodegit.node
#5 0x00007fc83eef3239 in SSL_load_error_strings () from /home/qa/Downloads/GitKraken/resources/app.asar.unpacked/node_modules/nodegit/build/Release/nodegit.node
#6 0x00007fc83ee70aca in init_once () from /home/qa/Downloads/GitKraken/resources/app
@johnhaley81
johnhaley81 / npm-stderr
Created May 10, 2016 15:44
Installing atom-keymap for electron version 0.37.8
johnhosx :: ~/Development/GitKraken ‹feature/update-electron-0.37.8› » npm install atom-keymap@atom/atom-keymap#master 1 ↵
> [email protected] install /Users/johnh/Development/GitKraken/node_modules/runas
> node-gyp rebuild
gyp ERR! configure error
gyp ERR! stack Error: Invalid version number: ^0.37.8
gyp ERR! stack at getNodeDir (/Users/johnh/.nvm/versions/node/v5.9.1/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:69:25)
gyp ERR! stack at /Users/johnh/.nvm/versions/node/v5.9.1/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:41:7
gyp ERR! stack at /Users/johnh/.nvm/versions/node/v5.9.1/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:393:9
@johnhaley81
johnhaley81 / factorialCallbackTest.js
Last active March 18, 2021 22:38
Factorial promise/generator test
function factorialCallback(acc, n, callback) {
if (n === 0) {
callback(acc);
} else {
setImmediate(() => factorialCallback(acc * n, n - 1, callback));
}
}
function timedFactorialCallback(n) {
const start = new Date();
@johnhaley81
johnhaley81 / CommitZone.jsx
Created April 27, 2017 16:02
Connector and Presentation components. Living Together!!
// @flow
import React from 'react';
import classnames from 'classnames';
import fp from 'lodash/fp';
import { connect } from 'react-redux';
import type {
MapDispatchToProps,
MapStateToProps
[{"tweet":{"created_at":"Thu May 11 17:21:03 +0000 2017","id":862719211717533700,"id_str":"862719211717533696","text":"The @GitKraken Chipotle button has appeared today. And now I'm hungry. https://t.co/2lkQsrS24n","truncated":false,"entities":{"hashtags":[],"symbols":[],"user_mentions":[{"screen_name":"GitKraken","name":"Axosoft GitKraken","id":3094114742,"id_str":"3094114742","indices":[4,14]}],"urls":[],"media":[{"id":862719198123794400,"id_str":"862719198123794432","indices":[71,94],"media_url":"http://pbs.twimg.com/tweet_video_thumb/C_j-ijEUIAAwsD-.jpg","media_url_https":"https://pbs.twimg.com/tweet_video_thumb/C_j-ijEUIAAwsD-.jpg","url":"https://t.co/2lkQsrS24n","display_url":"pic.twitter.com/2lkQsrS24n","expanded_url":"https://twitter.com/Cycododge/status/862719211717533696/photo/1","type":"photo","sizes":{"small":{"w":340,"h":154,"resize":"fit"},"medium":{"w":600,"h":272,"resize":"fit"},"thumb":{"w":150,"h":150,"resize":"crop"},"large":{"w":636,"h":288,"resize":"fit"}}}]},"extended_entities":{"media":
@johnhaley81
johnhaley81 / Person.hs
Created June 2, 2017 23:38
Spock and Yesod persisted types
{-# LANGUAGE EmptyDataDecls #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeFamilies #-}

Keybase proof

I hereby claim:

  • I am johnhaley81 on github.
  • I am johnhaley81 (https://keybase.io/johnhaley81) on keybase.
  • I have a public key ASB-ua8ysbm32WEPxuN7dMbQwXr8KuH_KkMo3TRsbwlr2Ao

To claim this, I am signing this object:

@johnhaley81
johnhaley81 / AxiosUtils.re
Created August 8, 2018 16:53
Example on wrapping a Reasonml binding to make a better API
open VowUtils.Infix;
module ErrorResponse = {
type t('a) = {
.
"config": Axios_types.config,
"response": {
.
"data": Js.Null.t(Js.Json.t),
"status": int,
module Decode = {
type failure = [ DecodeBase.failure | `InvalidOption];
let failureToString = (v: failure, json) =>
(
switch (v) {
| `ExpectedBoolean => "Expected boolean"
| `ExpectedString => "Expected string"
| `ExpectedNumber => "Expected number"
| `ExpectedInt => "Expected int"