Skip to content

Instantly share code, notes, and snippets.

View marcelarie's full-sized avatar
🐢
always learning

marcel marcelarie

🐢
always learning
View GitHub Profile
@mloskot
mloskot / cheat-tmux.markdown
Created December 14, 2012 13:11
tmux key bindings cheat shee

$ cheat tmux

Managing tmux sessions

$ tmux      # start tmux server
$ tmux at   # attach running sessions to a terminal
$ tmux ls # list running tmux sessions
@nickloewen
nickloewen / bret_victor-reading_list.md
Last active July 12, 2024 17:54
Bret Victor’s Reading List

This is a plain-text version of Bret Victor’s reading list. It was requested by hf on Hacker News.


Highly recommended things!

This is my five-star list. These are my favorite things in all the world.

A few of these works have had an extraordinary effect on my life or way of thinking. They get a sixth star. ★

@joseluisq
joseluisq / stash_dropped.md
Last active July 16, 2024 11:38
How to recover a dropped stash in Git?

How to recover a dropped stash in Git?

1. Find the stash commits

git log --graph --oneline --decorate ( git fsck --no-reflog | awk '/dangling commit/ {print $3}' )

This will show you all the commits at the tips of your commit graph which are no longer referenced from any branch or tag – every lost commit, including every stash commit you’ve ever created, will be somewhere in that graph.

MongoDB Cheat Sheet

Show All Databases

show dbs

Show Current Database

@egelev
egelev / connect_bluetooth_headphones.sh
Last active June 16, 2024 05:36
Connect bluetooth headphones on Ubuntu 18.04
#!/usr/bin/env bash
function get_headphones_index() {
echo $(pacmd list-cards | grep bluez_card -B1 | grep index | awk '{print $2}')
}
function get_headphones_mac_address() {
local temp=$(pacmd list-cards | grep bluez_card -C20 | grep 'device.string' | cut -d' ' -f 3)
temp="${temp%\"}"
temp="${temp#\"}"
@tjdevries
tjdevries / aligned_virt_text.lua
Created November 6, 2020 16:16
Aligned Virt Text Example (not guaranteed to work forever)
vim.lsp.diagnostic.get_virtual_text_chunks_for_line = function(bufnr, line, line_diagnostics)
if #line_diagnostics == 0 then
return nil
end
local line_length = #(vim.api.nvim_buf_get_lines(bufnr, line, line + 1, false)[1] or '')
local get_highlight = vim.lsp.diagnostic._get_severity_highlight_name
-- Create a little more space between virtual text and contents
local virt_texts = {{string.rep(" ", 80 - line_length)}}
@linderd
linderd / README.md
Last active July 11, 2024 01:38 — forked from timlinux/README.md
Linux on Thinkpad P14s Gen2 AMD / T14 Gen2 AMD

Linux (Fedora 35) on a Thinkpad P14s [T14] Gen2 AMD

These are my installation-tricks and notes for running Linux on a 2021 Thinkpad P14s Gen2 with AMD Ryzen 7 5850U. It should also be suitable for the Thinkpad T14 Gen2 AMD as they are technically the same modell.
Meanwhile there is also a good test on youtube and an entry in the arch-wiki, which also comments some points mentioned here.

Detailed specs

Shipped:

@jmatsushita
jmatsushita / README
Last active July 16, 2024 10:30
Setup nix, nix-darwin and home-manager from scratch on an M1 Macbook Pro
###
### [2023-06-19] UPDATE: Just tried to use my instructions again on a fresh install and it failed in a number of places.
###. Not sure if I'll update this gist (though I realise it seems to still have some traffic), but here's a list of
###. things to watch out for:
### - Check out the `nix-darwin` instructions, as they have changed.
### - There's a home manager gotcha https://github.com/nix-community/home-manager/issues/4026
###
# I found some good resources but they seem to do a bit too much (maybe from a time when there were more bugs).
# So here's a minimal Gist which worked for me as an install on a new M1 Pro.
@baatochan
baatochan / !README.md
Last active July 4, 2024 13:37 — forked from linderd/README.md
Linux (Manjaro [Arch]) on a Thinkpad P14s [T14] Gen2 with Intel

Linux (Manjaro [Arch]) on a Thinkpad P14s [T14] Gen2 with Intel

These are my installation-tricks and notes for running Linux on a 2021 Thinkpad P14s Gen2 with 11th gen Intel Core i7-1185G7. It should also be suitable for the Thinkpad T14 Gen2 with Intel as they are technically the same model.

Additionally you may find more AMD specific tips on the gist I've forked. I decided to keep this gist forked as I have used some of the tips they shared and because they inspired me to create my note in the first place.

Sadly there is no entry in the arch-wiki for Intel specific model, but some of the info from AMD one were useful for me. Other useful sources are mentioned in the document in their respective chapters.

Not everything in this doc may be 100% correct as I'm writing this note after having my PC set up and I might have forgotten some of the stuff. I will update it I ever decide to reinstall the OS on my PC.