Skip to content

Instantly share code, notes, and snippets.


Zander Martineau mrmartineau

View GitHub Profile
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 /
Last active Dec 26, 2020
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 /
Last active Aug 7, 2022
Stimulus cheatsheet
View gist:89b264dda8902f7f2ced90b114fc6704
Verifying my Blockstack ID is secured with the address 1yEg3gcmHZtHZp2eoFy8UocU3H8dxuKPh
mrmartineau /
Created Nov 18, 2017 — forked from jedmao/
Common git commands in a day-to-day workflow

Git Cheat Sheet

Initial Setup

Initialize a repo

Create an empty git repo or reinitialize an existing one

$ git init
mrmartineau /
Created Nov 18, 2017 — forked from jivoi/
Penetrating Testing/Assessment Workflow

Penetrating Testing/Assessment Workflow & other fun infosec stuff

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*

mrmartineau / .htaccess
Created Nov 18, 2017 — forked from ScottPhillips/.htaccess
Common .htaccess Redirects
View .htaccess
#301 Redirects for .htaccess
#Redirect a single page:
Redirect 301 /pagename.php
#Redirect an entire site:
Redirect 301 /
#Redirect an entire site to a sub folder
Redirect 301 /
mrmartineau / bling.js
Created Nov 18, 2017 — forked from paulirish/bling.js
bling dot js
View bling.js
/* bling.js */
window.$ = document.querySelectorAll.bind(document);
Node.prototype.on = window.on = function (name, fn) {
this.addEventListener(name, fn);
NodeList.prototype.__proto__ = Array.prototype;
mrmartineau /
Created Nov 18, 2017 — forked from WebReflection/
A basic Self Signed SSL Certificate utility
#!/usr/bin/env bash
# A basic Self Signed SSL Certificate utility
# by Andrea Giammarchi @WebReflection
# # to make it executable and use it
# $ chmod +x certificate
# $ ./certificate # to read the how-to
mrmartineau /
Last active Jul 26, 2019 — forked from ggauravr/
Array iteration methods summarized

While attempting to explain JavaScript's reduce method on arrays, conceptually, I came up with the following - hopefully it's helpful; happy to tweak it if anyone has suggestions.


JavaScript Arrays have lots of built in methods on their prototype. Some of them mutate - ie, they change the underlying array in-place. Luckily, most of them do not - they instead return an entirely distinct array. Since arrays are conceptually a contiguous list of items, it helps code clarity and maintainability a lot to be able to operate on them in a "functional" way. (I'll also insist on referring to an array as a "list" - although in some languages, List is a native data type, in JS and this post, I'm referring to the concept. Everywhere I use the word "list" you can assume I'm talking about a JS Array) This means, to perform a single operation on the list as a whole ("atomically"), and to return a new list - thus making it much simpler to think about both the old list and the new one, what they contain, and