Skip to content

Instantly share code, notes, and snippets.


Gleb Mazovetskiy glebm

View GitHub Profile
ascclemens /
Last active Apr 21, 2020
Rust and Travis CI cache

Rust and Travis CI cache

Using Travis CI's cache is very useful and helps cut Rust job times way, way down. However, the way that the default caching for Cargo is set up means it will quickly bloat.

Travis currently checks ~/.cargo and target/ for any changes from the current cache after a build. There will always be changes in target/ if the source has changed, which it usually does when a Travis build runs. This means new incremental object files, fingerprints, and build script compilation files are being added to the cache every build.

mill1000 /
Last active Apr 7, 2021
Headless A2DP Audio Streaming on Raspbian Stretch


This gist will show how to setup Raspbian Stretch as a headless Bluetooth A2DP audio sink. This will allow your phone, laptop or other Bluetooth device to play audio wirelessly through a Rasperry Pi.


A quick search will turn up a plethora of tutorials on setting up A2DP on the Raspberry Pi. However, I felt this gist was necessary because this solution is:

  • Automatic & Headless - Once setup, the system is entirely automatic. No user iteration is required to pair, connect or start playback. Therefore the Raspberry Pi can be run headless.
  • Simple - This solution has few dependencies, readily available packages and minimal configuration.
  • Up to date - As of December 2017. Written for Raspbian Stretch & Bluez 5.43


glebm /
Last active Sep 14, 2017
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.



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 /
Last active Oct 12, 2018
Universal Rails async onPageLoad script (Turbolink v2, v5.0, v5.1, jquery-turbolinks, and no Turbolinks)

This lets you load application JavaScript asynchronously from <head>. Compatible with Turbolink v2, v5.0, v5.1, jquery-turbolinks, and no Turbolinks. Compatible with all browsers and IE9+ (only IE10+ will actually benefit from this though).

How to use this:

  1. Add the HTML snippet just before the closing </body> tag.

  2. Add the on_page_load.js script to the beginning of your application.js, and use window.App.onPageLoad(...) instead of document.addEventListener('DOMContentLoaded', ...) and jQuery(($) -> ...) everywhere.

  3. Include your JavaScript like so:

101v / NatualScrollingInWindows.ps1
Created Jan 18, 2017
Powershell script to enable natural scrolling in Windows
View NatualScrollingInWindows.ps1
# View registry settings
Get-ItemProperty HKLM:\SYSTEM\CurrentControlSet\Enum\HID\*\*\Device` Parameters FlipFlopWheel -EA 0
# Change registry settings
# Reverse mouse wheel scroll FlipFlopWheel = 1
# Normal mouse wheel scroll FlipFlopWheel = 0
Get-ItemProperty HKLM:\SYSTEM\CurrentControlSet\Enum\HID\*\*\Device` Parameters FlipFlopWheel -EA 0 | ForEach-Object { Set-ItemProperty $_.PSPath FlipFlopWheel 1 }
# Restore default scroll direction
# Get-ItemProperty HKLM:\SYSTEM\CurrentControlSet\Enum\HID\*\*\Device` Parameters FlipFlopWheel -EA 1 | ForEach-Object { Set-ItemProperty $_.PSPath FlipFlopWheel 0 }
alirobe / reclaimWindows10.ps1
Last active Apr 10, 2021
This Windows 10 Setup Script turns off a bunch of unnecessary Windows 10 telemetery, bloatware, & privacy things. Not guaranteed to catch everything. Review and tweak before running. Reboot after running. Scripts for reversing are included and commented. Fork of (different defaults). N.…
View reclaimWindows10.ps1
# Tweaked Win10 Initial Setup Script
# Primary Author: Disassembler <>
# Modified by: alirobe <> based on my personal preferences.
# Version: 2.20.2, 2018-09-14
# Primary Author Source:
# Tweaked Source:
# Tweak difference:
# @alirobe's version is a subset focused on safely disabling telemetry, some 'smart' features and 3rd party bloat ...
jagtesh / arel_patches.rb
Created Feb 23, 2016
Arel goodness (with CASE statement) in < v7
View arel_patches.rb
# Remove this for Arel v7.0
module Arel
module Nodes
class Case < Arel::Nodes::Node
include Arel::OrderPredications
include Arel::Predications
include Arel::AliasPredication
attr_accessor :case, :conditions, :default
View Cargo.toml
name = "fst-int"
version = "0.1.0"
authors = ["Andrew Gallant <>"]
byteorder = "0.4"
fst = "0.1"
fevangelou / my.cnf
Last active Apr 10, 2021
Optimized my.cnf configuration for MySQL/MariaSQL (on Ubuntu, CentOS etc. servers)
View my.cnf
# === Optimized my.cnf configuration for MySQL/MariaSQL (on Ubuntu, CentOS etc. servers) ===
# by Fotis Evangelou, developer of Engintron (
# ~ Updated February 2021 ~
# The settings provided below are a starting point for a 8-16 GB RAM server with 4-8 CPU cores.
# If you have different resources available you should adjust accordingly to save CPU, RAM & disk I/O usage.