Skip to content

Instantly share code, notes, and snippets.

@anantoghosh
anantoghosh / confluence_clean.js
Created April 23, 2021 06:34
Clean Confluence page for saving/printing
/**
* Clean Confluence page for saving/printing
* Compared to save as pdf feature in confluence, this maintains the exact visual style.
* Save this in Sources -> Snippets
*/
// Remove top navigation
document.querySelector('[data-testid=grid-topNav]')?.remove()
// Remove toolbar
# Basic commands
:Git [args] # does what you'd expect
all of your `~/.gitconfig` aliases are available.
:Git! [args] # same as before, dumping output to a tmp file
Moving inside a repo.

Typesetting Libraries and Plugins

These are tools that improve typographic details like microtypography and typographic syntax automatically.

Additions welcome!

Name Language/Platform
Detergent JavaScript (ESM)
JoliTypo PHP
@coltenkrauter
coltenkrauter / fix-wsl2-dns-resolution
Last active May 19, 2024 03:54
Fix DNS resolution in WSL2
More recent resolution:
1. cd ~/../../etc (go to etc folder in WSL).
2. echo "[network]" | sudo tee wsl.conf (Create wsl.conf file and add the first line).
3. echo "generateResolvConf = false" | sudo tee -a wsl.conf (Append wsl.conf the next line).
4. wsl --terminate Debian (Terminate WSL in Windows cmd, in case is Ubuntu not Debian).
5. cd ~/../../etc (go to etc folder in WSL).
6. sudo rm -Rf resolv.conf (Delete the resolv.conf file).
7. In windows cmd, ps or terminal with the vpn connected do: Get-NetIPInterface or ipconfig /all for get the dns primary and
secondary.
@fcamblor
fcamblor / git-flip-last.sh
Last active August 5, 2022 16:00 — forked from eddiemoya/git-flip-last.sh
Flip the last two commits in a branch using git-cherry-pick, git-update-ref and git-rev-parse. Interesting exercise using quite a bit of plumbing commands.
#!/bin/bash
flip_last_branch_name=ongoing-flip-last;
git rev-parse --verify $flip_last_branch_name > /dev/null 2>&1;
res=$?;
if [ "$res" = "0" ]; then
echo "An ongoing flip-last is already in progress ($res) ... execute following command to remove it : git branch -D $flip_last_branch_name";
exit -1;
fi;
import React from "react";
import { Location } from "@reach/router";
let scrollPositions = {};
class ManageScrollImpl extends React.Component {
componentDidMount() {
try {
// session storage will throw for a few reasons
// - user settings
@developit
developit / *valoo.md
Last active November 13, 2023 08:39
🐻 Valoo: just the bare necessities of state management. 150b / 120b. https://npm.im/valoo

🐻 valoo

just the bare necessities of state management.

Usage

Hotlink it from https://unpkg.com/valoo.

See Interactive Codepen Demo.

@fauxpark
fauxpark / applefn.patch
Last active May 10, 2024 07:54
QMK Apple Fn
diff --git a/builddefs/common_features.mk b/builddefs/common_features.mk
index 18f8b0bbfc..4ef3e230e4 100644
--- a/builddefs/common_features.mk
+++ b/builddefs/common_features.mk
@@ -878,6 +878,10 @@ ifeq ($(strip $(JOYSTICK_ENABLE)), yes)
endif
endif
+ifeq ($(strip $(APPLE_FN_ENABLE)), yes)
+ OPT_DEFS += -DAPPLE_FN_ENABLE
@BoGnY
BoGnY / README.md
Last active May 7, 2024 07:02
[WINDOWS] How to enable auto-signing Git commits with GnuPG for programs that don't support it natively

[WINDOWS] How to enable auto-signing Git commits with GnuPG for programs that don't support it natively

This is a step-by-step guide on how to enable auto-signing Git commits with GPG for every applications that don't support it natively (eg. GitHub Desktop, Eclipse, Git Tower, ...)

Requirements

  • Install GPG4Win: this software is a bundle with latest version of GnuPG v2, Kleopatra v3 certificate manager, GNU Privacy Assistant (GPA) v0.9 which is a GUI that uses GTK+, GpgOL and GpgEX that are respectively an extension for MS Outlook and an extension for Windows Explorer shell
  • Install Git for Windows: so you can have a *nix based shell, this software is a bundle with latest version of Git which use MINGW environment, a Git bash shell, a Git GUI and an extension for Windows Explorer shell (Make sure your local version of Git is at least 2.0, otherwise Git don't have support for automatically sign your commits)
  • Verify
@IgnoredAmbience
IgnoredAmbience / 99-noto-mono-color-emoji.conf
Last active May 8, 2024 06:50
Noto Emoji Color fontconfig for Konsole
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<!--
Noto Mono + Color Emoji Font Configuration.
Currently the only Terminal Emulator I'm aware that supports colour fonts is Konsole.
Usage:
0. Ensure that the Noto fonts are installed on your machine.
1. Install this file to ~/.config/fontconfig/conf.d/99-noto-mono-color-emoji.conf