Skip to content

Instantly share code, notes, and snippets.

View deepanchal's full-sized avatar
🎯
Focusing

Deep Panchal deepanchal

🎯
Focusing
View GitHub Profile
@deepanchal
deepanchal / starship.toml
Last active July 6, 2024 09:30
Starship config
# Get editor completions based on the config schema
"$schema" = 'https://starship.rs/config-schema.json'
format = """
$username\
$hostname\
$localip\
$shlvl\
$singularity\
$kubernetes\
@PanAeon
PanAeon / btrbk.nix
Last active July 23, 2024 16:41
Btrbk on nixos
{ config, pkgs, lib, ... }:
let
cfg = config.services.btrbk;
sshEnabled = cfg.sshAccess != [ ];
serviceEnabled = cfg.instances != { };
attr2Lines = attr:
let
pairs = lib.attrsets.mapAttrsToList (name: value: { inherit name value; }) attr;
isSubsection = value:
if builtins.isAttrs value then true
@sindresorhus
sindresorhus / esm-package.md
Last active September 18, 2024 22:09
Pure ESM package

Pure ESM package

The package that linked you here is now pure ESM. It cannot be require()'d from CommonJS.

This means you have the following choices:

  1. Use ESM yourself. (preferred)
    Use import foo from 'foo' instead of const foo = require('foo') to import the package. You also need to put "type": "module" in your package.json and more. Follow the below guide.
  2. If the package is used in an async context, you could use await import(…) from CommonJS instead of require(…).
  3. Stay on the existing version of the package until you can move to ESM.
@probonopd
probonopd / Wayland.md
Last active September 19, 2024 18:58
Think twice about Wayland. It breaks everything!

Think twice before abandoning Xorg. Wayland breaks everything!

Hence, if you are interested in existing applications to "just work" without the need for adjustments, then you may be better off avoiding Wayland.

Wayland solves no issues I have but breaks almost everything I need. Even the most basic, most simple things (like xkill) - in this case with no obvious replacement. And usually it stays broken, because the Wayland folks mostly seem to care about Automotive, Gnome, maybe KDE - and alienating everyone else (e.g., people using just an X11 window manager or something like GNUstep) in the process.

The Wayland project seems to operate like they were starting a greenfield project, whereas at the same time they try to position Wayland as "the X11 successor", which would clearly require a lot of thought about not breaking, or at least providing a smooth upgrade path for, existing software.

In fact, it is merely an incompatible alternative, and not e

@deepanchal
deepanchal / spacing.css
Last active June 3, 2020 15:53
Bootstrap style CSS spacing helper classes
.m-0 { margin: 0; }
.p-0 { padding: 0; }
.mt-0 { margin-top: 0; }
.pt-0 { padding-top: 0; }
.mr-0 { margin-right: 0; }
.pr-0 { padding-right: 0; }
.mb-0 { margin-bottom: 0; }
.pb-0 { padding-bottom: 0; }
.ml-0 { margin-left: 0; }
.pl-0 { padding-left: 0; }
@ryo-ARAKI
ryo-ARAKI / starship.toml
Last active September 19, 2024 06:16
Starship configuration file
# ~/.config/starship.toml
[battery]
full_symbol = "🔋"
charging_symbol = "🔌"
discharging_symbol = ""
[[battery.display]]
threshold = 30
style = "bold red"
@borekb
borekb / README.md
Last active September 2, 2024 16:26
How to link to headings in GitHub issues and pull requests

How to link to headings in GitHub issues and pull requests

If you have an issue comment / PR description on GitHub, it doesn't automatically get anchors / IDs that you could link to:

Screenshot 2019-07-11 at 13

What I like to do is to add a visible # character like this:

Screenshot 2019-07-11 at 13 42 21

@andersevenrud
andersevenrud / alacritty-tmux-vim_truecolor.md
Last active September 19, 2024 03:25
True Color (24-bit) and italics with alacritty + tmux + vim (neovim)

True Color (24-bit) and italics with alacritty + tmux + vim (neovim)

This should make True Color (24-bit) and italics work in your tmux session and vim/neovim when using Alacritty (and should be compatible with any other terminal emulator, including Kitty).

Testing colors

Running this script should look the same in tmux as without.

curl -s https://gist.githubusercontent.com/lifepillar/09a44b8cf0f9397465614e622979107f/raw/24-bit-color.sh >24-bit-color.sh
@bradtraversy
bradtraversy / mysql_cheat_sheet.md
Last active September 20, 2024 06:00
MySQL Cheat Sheet

MySQL Cheat Sheet

Help with SQL commands to interact with a MySQL database

MySQL Locations

  • Mac /usr/local/mysql/bin
  • Windows /Program Files/MySQL/MySQL version/bin
  • Xampp /xampp/mysql/bin

Add mysql to your PATH