Skip to content

Instantly share code, notes, and snippets.

👋
Coding

Zander Martineau mrmartineau

👋
Coding
Block or report user

Report or block mrmartineau

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
View chrome-extensions.md
  • 1Password extension
  • Pesticide for Chrome
  • JSON Formatter
  • Octotree
  • Octo Preview
  • Feature Queries Manager
  • Copy as Markdown
  • React Developer Tools
  • Copy Title and Url as Markdown Style
  • Refined GitHub
@mrmartineau
mrmartineau / settings.json
Last active Dec 17, 2018
vscode settings.json
View settings.json
{
"auto-rename-tag.activationOnLanguage": ["*"],
"bookmarks.treeview.visible": false,
"bracketPairColorizer.showBracketsInGutter": true,
"breadcrumbs.enabled": true,
"css.validate": false,
"diffEditor.ignoreTrimWhitespace": false,
"editor.autoIndent": true,
"editor.codeActionsOnSave": {
"source.organizeImports": false
@mrmartineau
mrmartineau / .babelrc
Last active Jul 1, 2018
jest/styled-components snapshot bug...
View .babelrc
{
"presets": [
[
"env",
{
"modules": false
}
],
"react"
],
View connect.js
import React from 'react'
import { connect } from 'react-redux'
import { doClearQuery } from './some/file/of/action/creators'
// We again use a simple, functional component.
const OurComponent = ({ query, results, clearQuery }) => (
<div>
query: {query}
<button onClick={clearQuery}>Clear</button>
<ul>
@mrmartineau
mrmartineau / authorizationHeader.js
Created May 16, 2018
setting an authorization header
View authorizationHeader.js
const USERNAME = 'admin@foobar.com'
const TOKEN = 'hPPacTBSv7k0xAhAJrZjtmrmfhBj6rYd4UVfZvCO'
const authToken = btoa(
unescape(encodeURIComponent(`${USERNAME}:${TOKEN}`))
)
// authToken = 'YWRtaW5AZm9vYmFyLmNvbTpoUFBhY1RCU3Y3azB4QWhBSnJaanRtcm1maEJqNnJZZDRVVmZadkNP'
@mrmartineau
mrmartineau / package.json
Last active May 8, 2018
Pre-commit stuff
View package.json
// 1
scripts: {
// ...
"precommit": "lint-staged",
"lint-staged-stash": "git stash save --keep-index 'lint-staged' && touch .didstash || rm .didstash || true",
"lint-staged-stash-pop": "test -f .didstash && rm .didstash && git stash pop || true"
},
"lint-staged": {
"*.js": ["lint-staged-stash", "eslint --fix", "git add", "lint-staged-stash-pop"]
},
View IntersectionObserver.js
var callback = (entries, observer) => {
entries.forEach(entry => {
console.log('entry', entry)
// Each entry describes an intersection change for one observed
// target element:
// entry.boundingClientRect
// entry.intersectionRatio
// entry.intersectionRect
// entry.isIntersecting
// entry.rootBounds
@mrmartineau
mrmartineau / grid.md
Last active Jun 24, 2019
CSS grid snippets
View grid.md

Basic grid

.grid {
  display: grid;
  grid-gap: 30px;
  grid-template-columns: repeat(auto-fill, 112px);
  /* or this */
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
}
You can’t perform that action at this time.