Skip to content

Instantly share code, notes, and snippets.

View twitchel's full-sized avatar
🐶

Daniel K. Jones twitchel

🐶
  • Sydney, Australia
  • 14:47 (UTC +11:00)
View GitHub Profile
@sidouglas
sidouglas / jest-spy-on-all.js
Last active April 26, 2022 01:43
Jest spy on everything
export default (interrogate, mockImplementations = {}) => {
const spies = {}
interrogate.prototype && Object.getOwnPropertyNames(interrogate.prototype).forEach((name) => {
if (name !== 'constructor') {
spies[`${name}Spy`] = createSpy(interrogate.prototype, mockImplementations, name)
}
// AFAIK, you can't spy on a constructor
// top answer is here: https://stackoverflow.com/a/48486214/1090606
// For now, mock the entire module to assert that the constructor was called correctly.
@benrowe
benrowe / Makefile
Last active June 16, 2020 01:55 — forked from prwhite/Makefile
Add a help target to a Makefile that will allow all targets to be self documenting
.PHONY: help
# COLORS
GREEN := $(shell tput -Txterm setaf 2)
YELLOW := $(shell tput -Txterm setaf 3)
WHITE := $(shell tput -Txterm setaf 7)
RESET := $(shell tput -Txterm sgr0)
TARGET_MAX_CHAR_NUM=20
@roadrunner2
roadrunner2 / 0 Linux-On-MBP-Late-2016.md
Last active November 15, 2024 17:51
Linux on MacBook Pro Late 2016 and Mid 2017 (with Touchbar)

Introduction

This is about documenting getting Linux running on the late 2016 and mid 2017 MPB's; the focus is mostly on the MacBookPro13,3 and MacBookPro14,3 (15inch models), but I try to make it relevant and provide information for MacBookPro13,1, MacBookPro13,2, MacBookPro14,1, and MacBookPro14,2 (13inch models) too. I'm currently using Fedora 27, but most the things should be valid for other recent distros even if the details differ. The kernel version is 4.14.x (after latest update).

The state of linux on the MBP (with particular focus on MacBookPro13,2) is also being tracked on https://github.com/Dunedan/mbp-2016-linux . And for Ubuntu users there are a couple tutorials (here and here) focused on that distro and the MacBook.

Note: For those who have followed these instructions ealier, and in particular for those who have had problems with the custom DSDT, modifying the DSDT is not necessary anymore - se

@rhcarvalho
rhcarvalho / old.sh
Created November 5, 2016 19:29
List old files in a Git repository by last modification date
git ls-tree -r --name-only HEAD | while read filename; do
echo "$(git log -1 --format="%ad" --date=short -- $filename) $filename";
done | sort | head -20
# sleepy flower girl
(◡ ‿ ◡ ✿)
# y u no
ლ(ಠ益ಠლ)
# smiling breasts
(^人^)
# flipping tables