Skip to content

Instantly share code, notes, and snippets.

View maxlath's full-sized avatar

maxlath maxlath

View GitHub Profile
@lucaswerkmeister
lucaswerkmeister / setTransaction.js
Created June 6, 2018 16:55
inventaire.io: set the transaction status of all items by the current user to a certain status
/**
* Set the transaction status of all items by the current user to the given status.
*/
async function setTransaction(transaction) {
const userId = await fetch('https://inventaire.io/api/user', { credentials: 'include' })
.then(response => response.json())
.then(json => json._id);
const items = await fetch(`https://inventaire.io/api/items?action=by-users&users=${userId}`)
.then(response => response.json())
.then(json => json.items);
@Kirkkt
Kirkkt / git diff ignoring certain files.md
Last active November 6, 2023 12:36
git diff ignoring certain files

git diff ignoring certain files

What is this?

Sometimes you want to ignore certain files when you run git diff, but you still want to check them in, which means you can't capitalize on .gitignore.

This guide is here to help.

How to set it up?

@wisq
wisq / gist:0fa021df52a3bd2485ac
Last active June 3, 2023 04:18
Protip: Bisecting a single commit

Situation: Some commit (on master, but not necessarily head of master) has broken things, but it's a big commit and it's not clear what part broke things.

% git checkout master
% git checkout -b bisect-branch
% git revert <offending commit>

(test here to make sure reverting fixed your problem)

% git bisect start