Skip to content

Instantly share code, notes, and snippets.

function findImports (j, ast, pkg) {
return ast.find(j.ImportDeclaration, {
source: {
value: pkg
}
})
}
/**
* Detects CommonJS and import statements for the given package.
* @return true if import were found, else false
const getKeyName = keyCode => {
switch (keyCode) {
case 37:
return "left";
case 38:
return "up";
case 39:
return "right";
case 40:
return "down";
@chrislaughlin
chrislaughlin / Top-5-Chrome-Developer-Tools-Features.md
Last active October 3, 2018 06:44
#ReactiveConf 2018: Lighting Talk Submission

This is a proposal for a lightning talk at Reactive Conf. Please 🌟 this gist to push the proposal! If you're on your phone, please request the 🖥 desktop site to star this gist 😇 #ReactiveConf

#Top 5 Chrome Developer Tools Features

A quick paced look at my top 5 most used and most useful Chrome Developers Tools features. From inspecting elements to profiling applications.

@chrislaughlin
chrislaughlin / Theres-no-Imposters-Here.md
Last active September 3, 2018 21:00
#ReactiveConf 2018: Lighting Talk Submission

https://reactiveconf.com/

This is a proposal for a lightning talk at Reactive Conf. Please 🌟 this gist to push the proposal! If you're on your phone, please request the 🖥 desktop site to star this gist 😇 #ReactiveConf

There’s no Imposters Here

The google trend for imposter syndrome took a spike in December 2014, it wasn’t until mid 2017 that the topic reached peek in the tech industry. It is an indiscriminate force that affects all people in tech. Fueled by the constant bombardment of blog posts, tweets and new advancements in technology. Imposter syndrome can haunt someone throughout their career.

However “there are no imposters here” The tech community is actively working to remove barriers and provide inclusion for all. In these times we need to identify and stop imposter syndrome.

@chrislaughlin
chrislaughlin / test.jsx
Created August 1, 2018 11:36
Allow text selection
<div
onClick={event => {
if (document.getSelection() === '') {
event.stopPropigation();
}
}
>
text
</div>
//Click first close span
const possibleText = ['CLose', 'Dismiss', 'Close', 'I agree'];
const possibleTags = ['span', 'button', 'a'];
const findAndClick = tag => {
Array.from(
document.querySelectorAll(tag)
).find(item => {
let found = false;
possibleText.forEach(text => {
<ActionsTable
columns={columnConfig}
componentsConfig={componentConfig}
selectableRows
fixedHeight={'40vh'}
singleRowSelected={onUserSelected}
data={data}
tableOptions={{
tableTitle: true,
search: true,
@chrislaughlin
chrislaughlin / travis.md
Created March 31, 2018 16:20
Using Travis CI with Gatsby

First set out your build scripts In your package.json scripts and install the gh-pages npm module

"build": "gatsby build",
"test": "echo \"no test specified\" && exit 0",
"preDeploy": "gatsby build --prefix-paths",
"deploy": "npm run preDeploy && gh-pages -d public"

Connect Travis CI to your repo and in the repo settings add an enviroment var call GITHUB_TOKEN with the value of your github token from:

http://thedyslexicdeveloper.com/#/?_k=tj9n2a
http://pongtest.christopherlaughlin.co.uk/
http://zgrossbart.github.io/jsprofarticle/index1.htm
@chrislaughlin
chrislaughlin / rotate.js
Created June 6, 2017 21:09
Rotate Images
$('img').css('transform', 'rotate(90deg)');