Skip to content

Instantly share code, notes, and snippets.

View mrmartineau's full-sized avatar
👋
Aho Young Warrior

Zander Martineau mrmartineau

👋
Aho Young Warrior
View GitHub Profile
@mrmartineau
mrmartineau / connect.js
Created June 6, 2018 14:24
Redux examples
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 15:48
setting an authorization header
const USERNAME = 'admin@foobar.com'
const TOKEN = 'hPPacTBSv7k0xAhAJrZjtmrmfhBj6rYd4UVfZvCO'
const authToken = btoa(
unescape(encodeURIComponent(`${USERNAME}:${TOKEN}`))
)
// authToken = 'YWRtaW5AZm9vYmFyLmNvbTpoUFBhY1RCU3Y3azB4QWhBSnJaanRtcm1maEJqNnJZZDRVVmZadkNP'
@mrmartineau
mrmartineau / dev-resources.md
Last active March 23, 2023 00:20
My go-to resources for working on the web.
@mrmartineau
mrmartineau / package.json
Last active May 8, 2018 10:06
Pre-commit stuff
// 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"]
},
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 December 26, 2020 17:11
CSS grid snippets

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));
}
@mrmartineau
mrmartineau / stimulus.md
Last active April 19, 2024 09:41
Stimulus cheatsheet
Verifying my Blockstack ID is secured with the address 1yEg3gcmHZtHZp2eoFy8UocU3H8dxuKPh https://explorer.blockstack.org/address/1yEg3gcmHZtHZp2eoFy8UocU3H8dxuKPh
@mrmartineau
mrmartineau / gitcom.md
Created November 18, 2017 22:33 — forked from jednano/gitcom.md
Common git commands in a day-to-day workflow

Git Cheat Sheet

Initial Setup

Create an empty git repo or reinitialize an existing one

$ git init
@mrmartineau
mrmartineau / offsec.md
Created November 18, 2017 22:32 — forked from jivoi/offsec.md
Penetrating Testing/Assessment Workflow

Penetrating Testing/Assessment Workflow & other fun infosec stuff

https://github.com/jivoi/pentest

My feeble attempt to organize (in a somewhat logical fashion) the vast amount of information, tools, resources, tip and tricks surrounding penetration testing, vulnerability assessment, and information security as a whole*