Skip to content

Instantly share code, notes, and snippets.

View xref-fallback.el
(use-package lsp-haskell
:config
(setq lsp-haskell-process-path-hie "haskell-language-server-wrapper")
;; xref backends don't compose. This creates one that first consults the
;; xref-lsp backend for the latest information from the language server,
;; and then falls through to etags for library definitions.
(defun my/xref-lsp-etags-backend () 'my/lsp-etags)
(cl-defmethod xref-backend-identifier-at-point ((_backend (eql my/lsp-etags)))
(xref-backend-identifier-at-point 'xref-lsp))
@ssledz
ssledz / spacemacs-keybindings.md
Created Jan 26, 2022 — forked from rnwolf/spacemacs-keybindings.md
spacemacs keybindings that i need to learn
View spacemacs-keybindings.md
View curl-cheat-sheet.md

Check cors origin policy

curl -v -X OPTIONS \
  --header 'Origin: http://some.origin.here' \
  --header 'Access-Control-Request-Method: GET' \
  http://localhost:8085/tokens 
View getopts-template.sh
#!/bin/bash
DBG=0
dbg() {
[[ $DBG == 1 ]] && (1>&2 echo "[DEBUG] : "$1)
}
info() {
echo "[INFO] : $1"
View installing-HL2270DW.md

Installing printer Brother HL2270DW

Preparing

sudo aa-complain cupsd
sudo mkdir /usr/share/cups/model
sudo ln -s /etc/init.d/cups /etc/init.d/lp
sudo mkdir /var/spool/lpd
sudo apt-get install ia32-libs
@ssledz
ssledz / Utf8Decoder.scala
Last active Aug 4, 2020
Flexible and Economical UTF-8 Decoder
View Utf8Decoder.scala
/**
* https://bjoern.hoehrmann.de/utf-8/decoder/dfa/
*/
object Utf8Decoder {
private val Utf8Accept: Int = 0
private val Utf8Reject: Int = 1
//@formatter:off
private val utf8d : Array[Int] = Array(
@ssledz
ssledz / llvm-alternatives.sh
Created Jun 13, 2020
llvm-4.0 alternatives
View llvm-alternatives.sh
#!/usr/bin/env sh
# Remove all existing alternatives
sudo update-alternatives --remove-all llvm
# exit on first error
set -e
# llvm-4.0
sudo update-alternatives \
@ssledz
ssledz / Setup GCC and CLANG Toolchains.md
Created Jun 13, 2020 — forked from bhaskarvk/Setup GCC and CLANG Toolchains.md
Proper GCC (vers. 5/6/7) & LLVM/CLANG (vers. 4/5) Toolchain Setup on Ubuntu/Linux Mint
View Setup GCC and CLANG Toolchains.md

This approach uses update-alternatives to manage GCC and LLVM/CLANG C/C++ compiler toolchains. Although tested on Linux Mint 18.3, this approach should work on any Debian based distro or for that matter any Linux distro with update-alternatives support, provided the packages are installed correctly.

There are 3 files

  • gcc-alternatives.sh installs GCC versions 5/6/7 and sets up alternatives for gcc/g++/cpp/gfortran.
  • llvm-clang-alternatives.sh installs LLVM and CLANG versions 4/5 and sets up alternatives for various LLVM and CLANG programs including clang and clang++.
  • cc-alternatives.sh sets up alternatives for the cc, cxx, and the ld commands. This script can be used to change systemwide default compiler/linker combination to either GCC or CLANG.

Once these scripts are run you can change the system GCC/CLANG versions by running sudo update-alternatives --config gcc|clang. To change the default compiler/linker combo used by t

@ssledz
ssledz / handbrake-how-to.md
Created May 25, 2020
How to convert a DVD to an MP4 File
View handbrake-how-to.md

install

sudo add-apt-repository ppa:stebbins/handbrake-releases  # to get latest
sudo apt update
sudo apt install handbrake-gtk
sudo apt install ubuntu-restricted-extras     # to install a collection of codecs
sudo apt install libdvd-pkg                   # to install a library that plays DVDs in Ubuntu
sudo dpkg-reconfigure libdvd-pkg              # do reconfigured if needed
@ssledz
ssledz / abcde-how-to.md
Created May 25, 2020
How to Easily Rip a CD with Abcde
View abcde-how-to.md

install

sudo apt-get install abcde

rip cd

abcde -o flac