Skip to content

Instantly share code, notes, and snippets.

Sam Johnson sam0x17

Block or report user

Report or block sam0x17

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
sam0x17 / Gemfile
Created Nov 17, 2019
How to get rails' 1.month and 3.seconds etc working in raw ruby
View Gemfile
gem 'active_support'
View gist:90a52cb74548bb7a47523fe4d41aa101
sam0x17 /
Created Nov 13, 2019
fix for installing ruby 2.5.x via RVM on macos


ossl_x509crl.cossl_x509cert.c:334:59: error: member reference type 'int' is not a pointer


rvm install 2.5.7 --with-openssl-dir=`brew --prefix openssl`
sam0x17 / settings.json
Created Aug 20, 2019
vscode multi-language indententation settings
View settings.json
"editor.tabSize": 2,
"editor.detectIndentation": true,
"[rust]": {
"editor.detectIndentation": true,
"editor.tabSize": 4
"[python]": {
"editor.detectIndentation": true,
"editor.tabSize": 4
sam0x17 /
Last active Aug 4, 2019
local docker environment setup
# set up docker volume and image (host ~ will be bound to /host)
docker volume create devenv
mkdir -p ~/.alpine-dev
docker run -v ~:/host -it --mount source=devenv,target=/Users/sam/.alpine-dev --name alpine-dev alpine
# setup within container:
apk add bash
ln -fs /bin/bash /bin/sh
adduser sam
apk add sudo
sam0x17 /
Created May 5, 2019
fix for firefox gtk3 (linux) dark mode theme issue

A partial fix is to add new string key to about:config with "widget.content.gtk-theme-override" name and "Adwaita:light" value.

View rust iterator equality
use std::fmt::Debug;
use std::cmp::PartialEq;
pub fn assert_iter_eq<T: Iterator, U: ExactSizeIterator>(a: T, b: U)
T: ExactSizeIterator,
<T as Iterator>::Item: Debug + PartialEq,
sam0x17 /
Last active Jan 25, 2019
True mobile viewport height

mobile browsers these days have annoying address bars / toolbars / etc that interfere with the viewport height, so if you have some 100vh elements they get partially obscured... to get the TRUE height of the viewport use:

Math.min(document.documentElement.clientHeight, window.screen.height, window.innerHeight);
require "gcf"
class Example < GCF::CloudFunction
def run(params : JSON::Any)
# your code here
sam0x17 / disable hotcorner
Created May 2, 2018
disable gnome activities top left hot corner
View disable hotcorner
install gnome extension:
You can’t perform that action at this time.