Skip to content

Instantly share code, notes, and snippets.

View nickytonline's full-sized avatar
🚀

Nick Taylor nickytonline

🚀
View GitHub Profile
@nickytonline
nickytonline / domBubbling.html
Last active August 29, 2015 14:15
Event management in the DOM via bubbling for Handlebars templating POC
<html>
<head>
<title>Client-Side Event Binding with HandleBards POC</title>
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css" />
<!--[if IE]>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<![endif]-->
<style type="text/css">
#logger {
height: 250px;
@nickytonline
nickytonline / compose.ts
Last active December 8, 2015 02:11
Messing around with functional progamming in TypeScript
export default function compose<T>(...functions: { (x: T): T }[]) {
return x => functions.reduce((previous, current) => x => current(previous(x)))(x);
}
/* usage:
const composed = compose<number>(x => x * 2,x => x * 3, x => x * 4);
console.log(composed(4)) //96
or
@nickytonline
nickytonline / repls.md
Created December 10, 2015 04:47
A list of useful REPLs
@nickytonline
nickytonline / local-npm-task.xml
Last active January 27, 2016 20:31
A Task for Windows Task Scheduler to run local-npm
<?xml version="1.0" encoding="UTF-16"?>
<Task version="1.2" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">
<RegistrationInfo>
<Date>2016-01-21T08:54:47.1813619</Date>
<Author>YOUR_DOMAIN\YOUR_USER</Author>
<Description>Runs local-npm a local version of npm that grabs packages from it's server if not already fetched. This essentially allows you to run npm offline, assuming you've installed the packages you need at least once.</Description>
</RegistrationInfo>
<Triggers>
<LogonTrigger>
<Enabled>true</Enabled>
@nickytonline
nickytonline / tslint.json
Created February 19, 2017 01:46
Preferred tslint.json
{
"rules": {
"align": [
true,
"parameters",
"arguments",
"statements"
],
"ban": false,
"class-name": true,
@nickytonline
nickytonline / iframe-button-click-error-webdriver-io.md
Created June 27, 2017 14:27
Error when clicking a button in an iframe using Webdriver IO, Chrome 59 and Chrome Driver 2.30

From web driver IO's browser.debug() when running my test. The iframe is found and the button is found, but it errors out when you click the button. And the weird thing is, it's not for all buttons in an iframe:

> const frameId = browser.$(iframeSelector).value
> browser.frame(frameId)
{ state: 'success',
  sessionId: 'b7431c7d-a458-490b-a7c2-d733e58f3f85',
  hCode: 307243156,
  value: null,
  class: 'org.openqa.selenium.remote.Response',
  _status: 0 }

Keybase proof

I hereby claim:

  • I am nickytonline on github.
  • I am nickytonline (https://keybase.io/nickytonline) on keybase.
  • I have a public key ASBEWNdvh5sdoMlT4StLMkid8-ZPj6_B1YaHLB15-j9SHwo

To claim this, I am signing this object:

@nickytonline
nickytonline / hoc-cdc.jsx
Created October 29, 2017 18:03
HOC with componentDidCatch
import React, { Component } from 'react';
import Sentry from '../services/sentry';
import DevError from '../components/DevError';
const DEV_ENV = 'development';
const CaptureError = ({
ComponentToWrap,
ErrorComponent,
environment = process.env.NODE_ENV,
import test from 'ava';
import React from 'react';
import { shallow } from 'enzyme';
import CaptureError from '../CaptureError';
const render = ({
ComponentToWrap,
ErrorComponent,
environment = 'development',
}) => {