Skip to content

Instantly share code, notes, and snippets.

View glebm's full-sized avatar

Gleb Mazovetskiy glebm

View GitHub Profile
@glebm
glebm / Fn keys.json
Last active April 29, 2024 03:32
MSI Prestige 16 AI Studio input-remapper config for Fn+Left/Right/Up/Down -> Home/End/PageUp/PageDown
[
{
"input_combination": [
{
"type": 1,
"code": 464,
"origin_hash": "121bafca5e72bccfe428d54bfef7c15e"
},
{
"type": 1,
during GIMPLE pass: dse
/home/gleb/devilutionX/Source/options.cpp: In function ‘AddAction.constprop’:
/home/gleb/devilutionX/Source/options.cpp:1700:6: internal compiler error: in binds_to_current_def_p, at symtab.cc:2494
1700 | void PadmapperOptions::AddAction(std::string_view key, const char *name, const char *description, ControllerButtonCombo defaultInput, std::function<void()> actionPressed, std::function<void()> actionReleased, std::function<bool()> enable, unsigned index)
| ^
during GIMPLE pass: store-merging
/home/gleb/devilutionX/build-windows9x-min/_deps/libfmt-src/include/fmt/format.h: In member function ‘__ct ’:
/home/gleb/devilutionX/build-windows9x-min/_deps/libfmt-src/include/fmt/format.h:2067:12: internal compiler error: in binds_to_current_def_p, at symtab.cc:2494
2067 | explicit digit_grouping(locale_ref loc, bool localized = true) {
| ^
@glebm
glebm / r-studio-chromeos-202101.md
Last active January 29, 2021 21:02
Install RStudio on ChromeOS (29 Jan 2021)

First, install Linux (beta) by following the "Turn on Linux (Beta)" steps described here https://support.google.com/chromebook/answer/9145439?hl=en-GB

Then, copy-paste the following command into the Linux terminal (the black window that opens after you install Linux) and press Enter:

sudo apt update && sudo apt -y upgrade && sudo apt -y install r-base wget libnss3 && \
  wget https://download1.rstudio.org/desktop/bionic/amd64/rstudio-1.4.1103-amd64.deb && \
  sudo apt -y install ./rstudio-1.4.1103-amd64.deb

This will take about ~10 minutes, after which you will have fully functional R-Studio with R v3.5.

@glebm
glebm / gamepad.cfg
Last active December 5, 2023 10:55
gamepad configuration for xash3d-fwgs
// Default gamepad bindings
// == Bindings ==
// https://raw.githubusercontent.com/krishenriksen/Half-Life-rg351p/da77c22b60c29589240b86608495574672105206/Half-Life/controls.png
//
// Left stick: Move/Strafe (Walk instead of run when pressed)
// Right stick: Look (Crouch when pressed)
// D-Pad Up: Spray
// D-Pad Down: Quick swap weapon
// D-Pad Left: Prev Weapon
--- /etc/mke2fs.conf 2019-09-30 18:57:59.000000000 +0100
+++ mke2fs.conf 2020-03-28 16:12:38.972403738 +0000
@@ -1,5 +1,5 @@
[defaults]
- base_features = sparse_super,large_file,filetype,resize_inode,dir_index,ext_attr
+ base_features = sparse_super,large_file,filetype,resize_inode,dir_index
default_mntopts = acl,user_xattr
enable_periodic_fsck = 0
blocksize = 4096
@@ -11,7 +11,7 @@
@glebm
glebm / FindSDL_gfx.cmake
Created February 15, 2020 19:02
FindSDL_gfx.cmake
# Tries to find SDL_gfx (for SDL1)
# Once done, this will define:
# > SDL_GFX_FOUND - The system has libnx
# > SDL_GFX_INCLUDE_DIRS - The libnx include directories
# > SDL_GFX_LIBRARIES - The libnx libraries required for using it
find_path(SDL_GFX_INCLUDE_DIR SDL_gfxPrimitives.h
HINTS
$ENV{SDL_GFX_DIR}
$ENV{SDLDIR}
@glebm
glebm / topsort.cpp
Created August 23, 2019 11:28
topsort c++
struct TopSortResult {
bool ok;
// If `ok`, contains the topologically sorted node indices.
// Otherwise, contains indices of a detected cycle.
std::vector<std::size_t> nodes;
};
// Topologically sorts dependencies.
TopSortResult topsort(const std::vector<std::vector<int>> &edges) {
diff --git a/src/extender.cpp b/src/extender.cpp
index 6d96b8d0..8456a6a1 100644
--- a/src/extender.cpp
+++ b/src/extender.cpp
@@ -287,11 +287,11 @@ namespace Sass {
// Note: this function could need some logic cleanup
// ##########################################################################
void Extender::addExtension(
- SelectorListObj& extender,
- SimpleSelectorObj& target,
@glebm
glebm / TextPlainStyleDarkCentered.md
Last active September 14, 2017 14:35
Light on dark centered content style for text/plain documents

This is a userscript with a light-on-dark content-centered style for plain/text documents.

light-on-dark-plain-text

Installation

To install this userscript in Chrome, save the JavaScript file and drag it onto the chrome://extensions page.

If you use ViolentMonkey, TamperMonkey, or GreaseMonkey, install from one of these links:

@glebm
glebm / RenderWhitespace.md
Last active September 26, 2017 11:17
Render whitespace on GitHub