Skip to content

Instantly share code, notes, and snippets.

@denisoster
denisoster / proton_exec.sh
Created January 10, 2021 14:43
Run another exe file from steam proton
#!/bin/bash
game_id=$1
game_folder=$2
executable_file=$3
### Checks
if [ -z "$game_id" ] || [ -z "$game_folder" ] || [ -z "$executable_file" ]; then
echo "Example: ./proton_exec.sh 211600 thief_gold \$HOME/executable_file.exe"

Troubleshooting

Versions differ on projects!

Whe using rmagick

Linux:
Need install imagemagick6

PKG_CONFIG_PATH='/usr/lib/imagemagick6/pkgconfig' gem install rmagick -v '2.13.4'
@denisoster
denisoster / keychron
Created October 16, 2020 12:06
Override keys
xkb_keymap {
xkb_types { include "complete" };
xkb_compat { include "complete" };
xkb_symbols { include "pc+us+ru:2+inet(evdev)" };
xkb_geometry { include "pc(pc105)" };
xkb_keycodes {
include "evdev+aliases(qwerty)"
<LWIN> = 64;
@denisoster
denisoster / pundit_adapter.rb
Created October 7, 2020 09:00
active_admin/pundit_adapter.rb
def scope_collection(collection, action = Auth::READ)
# # scoping is appliable only to read/index action
# # which means there is no way how to scope other actions
# Pundit.policy_scope!(user, namespace(collection))
# rescue Pundit::NotDefinedError => e
# if default_policy_class && default_policy_class.const_defined?(:Scope)
# default_policy_class::Scope.new(user, collection).resolve
# else
# raise e
# end
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH="/Users/denisoster/.oh-my-zsh"
# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
# frozen_string_literal: true
module Callable
# Makes object callable.
# Instance method #call must be defined.
# Usage:
#
# class SomeService
# include Callable
#
# frozen_string_literal: true
module Memoizable
# Allows to define memoized methods with ease.
# Usage:
#
# class SomeService
# include Memoizable
#
# def initialize(customer_id)
POSTGRES_EXTRA_CONFIGURE_OPTIONS="--with-gssapi --with-libxml --with-openssl --with-perl --with-python --with-tcl --with-pam --with-system-tzdata=/usr/share/zoneinfo --with-uuid=e2fs --with-icu --with-systemd --with-ldap --with-llvm --enable-nls --enable-thread-safety --disable-rpath" asdf install postgres
#!/bin/bash
Xephyr -ac -br -noreset -screen 1366x768 :1 &
sleep .1
DISPLAY=:1 awesome -c "/home/denis/.config/awesome/rc.lua"
pkill -KILL Xephyr
@denisoster
denisoster / example.js
Created May 5, 2020 08:07
'arrow function syntax (=>)' is only available in ES6 (use esnext option).
function disabledCheckBoxes(elements) {
document.querySelectorAll(elements).forEach(element => {
element.setAttribute("disabled", "disabled");
});
}
function enabledCheckBoxes(elements) {
document.querySelectorAll(elements).forEach(element => {
element.removeAttribute("disabled");