Skip to content

Instantly share code, notes, and snippets.

Avatar

Gleb Mazovetskiy glebm

  • Google
  • London
  • Twitter @glebm
View GitHub Profile
@glebm
glebm / r-studio-chromeos-202101.md
Last active January 29, 2021 21:02
Install RStudio on ChromeOS (29 Jan 2021)
View r-studio-chromeos-202101.md

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 January 17, 2023 07:13
gamepad configuration for xash3d-fwgs
View gamepad.cfg
// 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
View mke2fs.conf.diff
--- /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
View 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++
View topsort.cpp
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) {
View libsass-2908.patch
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
View TextPlainStyleDarkCentered.md

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 / generate.js
Last active October 24, 2017 18:57
A quick hack to generate a codepoint set presence condition (JS)
View generate.js
const regenerate = require('regenerate');
/* char-graphic? */
const SETS = ['Letter', 'Mark', 'Number', 'Punctuation', 'Symbol'].map(category =>
require(`unicode-10.0.0/General_Category/${category}/code-points.js`));
/* char-blank? */
// const SETS = [['\t']].concat(['Space_Separator'].map(category =>
// require(`unicode-10.0.0/General_Category/${category}/code-points.js`)));
@glebm
glebm / README.md
Last active August 4, 2022 23:24
Rails Link Preload Headers
View README.md

This lets you set the preload headers for your assets, so that the browser can start fetching them before it begins parsing HTML.