Skip to content

Instantly share code, notes, and snippets.

Avatar

Vadim Zaliva vzaliva

View GitHub Profile
@vzaliva
vzaliva / emacs-grammarly-support.txt
Created Apr 11, 2022
emacs grammarly support project
View emacs-grammarly-support.txt
I am a big fan of Grammarly ( https://grammarly.com/ ). I am also an Emacs user. I do most of my academic and technical writing in LaTeX or Org-mode in Emacs, and it is crucial for me to have Grammarly working there.
Until recently, there was a way to use Grammarly from Emacs using an unofficial LSP-server (https://github.com/znck/grammarly). Unfortunately, it stopped working and is no longer supported. The main developer was hired by Grammarly and said an official SDK would replace it, but it is unclear when it will happen, and I am not betting on it as company priorities might change.
The second part of this is lsp-grammarly (https://github.com/emacs-grammarly/lsp-grammarly) emacs package. It was working but could be improved.
The final part is to make lsp-grammarly work with org-mode and LaTeX-modes. The last time I used it, it worked reasonably well, but just in case, we can keep an eye on and fix issues reported.
It is such an important tool for my everyday work that I decided to initiate a project
@vzaliva
vzaliva / Hundred.hs
Last active Oct 22, 2021
Print numbers from 1 to 100 without using any numbers in the code
View Hundred.hs
{-# LANGUAGE NoImplicitPrelude #-}
{-
Problem statment: "Is it possible to print numbers from 1 to 100
without using any numbers in the code? If yes, how?"
Source:
https://www.quora.com/Is-it-possible-to-print-numbers-from-1-to-100-without-using-any-numbers-in-the-code-If-yes-how
For generality, this solution can print any ranges of natural numbers
@vzaliva
vzaliva / remove-old-kernels.sh
Created Apr 1, 2017
Script to free space on /boot partition by removing old kernels
View remove-old-kernels.sh
#!/bin/bash
kernelver=$(uname -r | sed -r 's/-[a-z]+//')
unused=`dpkg -l linux-{image,headers}-"[0-9]*" | awk '/ii/{print $2}' | grep -ve $kernelver`
echo "Your current kernel is version is $kernelver"
if [ -z "$unused" ]; then
echo "No old kernels to remove."
exit 0
fi
@vzaliva
vzaliva / WriterComonad.v
Last active Sep 26, 2021
Writer Comonad in Coq
View WriterComonad.v
Require Import Coq.Program.Basics.
Require Import Coq.Logic.FunctionalExtensionality.
Require Import ExtLib.Structures.Monads.
Require Import ExtLib.Data.Monads.IdentityMonad.
Require Import ExtLib.Structures.Monoid.
Require Import ExtLib.Data.Monads.WriterMonad.
Require Import ExtLib.Data.PPair.
Require Import ExtLib.Structures.CoMonad.
Require Import ExtLib.Core.Type.
@vzaliva
vzaliva / set_lang.py
Last active Apr 16, 2022
Script to toggle between the two last used language in Gnome
View set_lang.py
#!/usr/bin/env python3
#
# Script to toggle between the two last used language in Gnome
#
# History:
#
# Original script by Jacob Vlijm
# Saving last language and togging: Vadim Zaliva
#
# See also: http://askubuntu.com/questions/871678/how-can-i-quickly-switch-between-two-out-of-multiple-languages
@vzaliva
vzaliva / ThinkLight
Created May 22, 2016
This script controll keyboard backlight on IBM ThinkPad X-series
View ThinkLight
#!/bin/bash
# Vadim Zaliva lord@crocodile.org
# based on https://gist.github.com/hadess/6847281
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root" 1>&2
exit 1
fi