Skip to content

Instantly share code, notes, and snippets.

@jvince
jvince / gist:ffe5c0950ace802fd91ce8298095495c
Created August 20, 2024 11:46
Converting shallow repository to regular one (git)
https://stackoverflow.com/questions/74266133/git-unable-to-merge-unrelated-histories-shallow-clone
Never1 use --allow-unrelated-histories. Instead, deepen (or "unshallow") your clone. Edit: as per comments, you also need to convert your clone to a full clone (it's currently a single-branch clone, which I should have anticipated since using --depth during cloning defaults to creating a single-branch clone as well).
Merging, in Git, depends on three commits, not two:
there is your current commit (aka HEAD), which will represent work done since some common starting point;
there is some other commit, which will represent work done in some other branch since the same common starting point; and
there is a third commit, the merge base, which is this common starting point.
When you run git merge, the argument you supply—generally a branch name like feature or master—locates the middle of these three: the "other" or --theirs commit. The current or --ours commit is implied by what you have checked out. The third com
@jvince
jvince / gh-pages-deploy.md
Created May 7, 2024 18:46 — forked from cobyism/gh-pages-deploy.md
Deploy to `gh-pages` from a `dist` folder on the master branch. Useful for use with [yeoman](http://yeoman.io).

Deploying a subfolder to GitHub Pages

Sometimes you want to have a subdirectory on the master branch be the root directory of a repository’s gh-pages branch. This is useful for things like sites developed with Yeoman, or if you have a Jekyll site contained in the master branch alongside the rest of your code.

For the sake of this example, let’s pretend the subfolder containing your site is named dist.

Step 1

Remove the dist directory from the project’s .gitignore file (it’s ignored by default by Yeoman).

@jvince
jvince / Geohash.class.js
Last active September 17, 2023 17:39
Geohash encoding/decoding
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/* Geohash encoding/decoding and associated functions (c) Chris Veness 2014-2019 / MIT Licence */
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
const base32 = '0123456789bcdefghjkmnpqrstuvwxyz'; // (geohash-specific) Base32 map
/**
* Geohash: Gustavo Niemeyer’s geocoding system.
*/
@echo off
setlocal enabledelayedexpansion
setlocal
call :setESC
:: Set the directory and URL pattern
set TARGET_DIR=C:\ProgramData\GOG.com\Galaxy\webcache
set URL_BASE=https://images.gog.com
@jvince
jvince / remove-obsolete-gpg-key-from-dnf.md
Created June 2, 2023 10:43 — forked from e7d/remove-obsolete-gpg-key-from-dnf.md
Remove obsolete GPG key from DNF (Fedora)
@jvince
jvince / eui_data_grid_edit.js
Last active March 17, 2020 09:03
EUI DataGrid Edit Modal Example
import { EuiButton, EuiCodeBlock, EuiDataGrid, EuiModal, EuiModalBody, EuiOverlayMask, EuiPanel } from '@elastic/eui';
import React, { useMemo, useState } from 'react';
const data = [
{
'_id': '5e708581cc8113472f705ac0',
'name': 'Schmidt Hardin',
'company': 'UPDAT',
'email': '[email protected]',
'phone': '+1 (898) 479-2772'