Skip to content

Instantly share code, notes, and snippets.

View salaros's full-sized avatar
🎉
Making magic happen

Yaroslav Zhmayev salaros

🎉
Making magic happen
View GitHub Profile
@salaros
salaros / libpng12-0
Created February 11, 2019 09:26
libpng 12.0 i386 and amd64
sudo ln -sfv /lib/i386-linux-gnu/libpng16.so.16 /lib/i386-linux-gnu/libpng12.so.0
sudo ln -sfv /lib/x86_64-linux-gnu/libpng16.so.16 /lib/x86_64-linux-gnu/libpng12.so.0
@salaros
salaros / services-explained.md
Last active November 30, 2018 10:48
IServiceProvider in ASP.NET Core dependency injection explained

Either approach can be used to get access to the service. Additional service extensions for Startup.cs

Instance

AddInstance<IService>(new Service())

A single instance is given all the time. You are responsible for initial object creation.

@salaros
salaros / SetAsWallpaper.sh
Last active February 12, 2019 14:57
Set wallpaper on Ubuntu as well as lock and login screens
#!/usr/bin/env bash
set -- $NAUTILUS_SCRIPT_SELECTED_FILE_PATHS
WALLPAPER=${1/ /%20}
WALLPAPER_URL="'file:///${WALLPAPER}'"
gsettings set org.gnome.desktop.background picture-uri ${WALLPAPER_URL}
LOCKPAPER=/usr/share/backgrounds/gdmlock.jpg
LOCKPAPER_TMP=/tmp/gdmlock.jpg
@salaros
salaros / country-code-to-currency-code-mapping.csv
Created November 9, 2018 19:46 — forked from HarishChaudhari/country-code-to-currency-code-mapping.csv
Country, Country Code, Currency code mapping in CSV format Taken from https://gist.github.com/304261 Contains 249 countries.
Country CountryCode Currency Code
New Zealand NZ New Zealand Dollars NZD
Cook Islands CK New Zealand Dollars NZD
Niue NU New Zealand Dollars NZD
Pitcairn PN New Zealand Dollars NZD
Tokelau TK New Zealand Dollars NZD
Australian AU Australian Dollars AUD
Christmas Island CX Australian Dollars AUD
Cocos (Keeling) Islands CC Australian Dollars AUD
Heard and Mc Donald Islands HM Australian Dollars AUD
@salaros
salaros / etc__wsl.conf
Last active January 8, 2019 08:20
Make Docker work on Ubuntu WSL (Windows Subsystem for Linux)
[automount]
root = /
options = "metadata"
@salaros
salaros / acf-backend-form.php
Last active November 3, 2018 14:47
WordPress - ACF custom forms
<?php
require_once 'acf.php';
add_action('admin_head', function () {
do_action('acf/input/admin_head');
acf_form_head();
wp_enqueue_media();
});
add_action('admin_enqueue_scripts', function () {
;; Copy current boot option and call it "No Hyper-V"
bcdedit /copy {current} /d "No Hyper-V"
;; Copy guid from the command above
bcdedit /set {ff-23-113-824e-5c5144ea} hypervisorlaunchtype off
@salaros
salaros / ubuntu-tweak.sh
Last active January 19, 2020 19:40
My tweaks for Ubuntu + Dell Inspiron 5567
#!/usr/bin/env bash
# Require root to run
if [ "$EUID" -ne 0 ]; then
echo "Please run as root"
exit 0
fi
# [PlayOnLinux] - disables protection against the usage of Ptrace
# https://www.playonlinux.com/en/topic-10534-Regarding_ptrace_scope_fatal_error.html
@salaros
salaros / adobe-photoshop-winetricks.sh
Created October 14, 2018 20:18
Wine tricks recipe for Adobe Photoshop CC 2018
WINEARCH=win64 WINEPREFIX=$HOME/.PlayOnLinux/wineprefix/Photoshop/ winetricks \
atmlib flash \
corefonts gdiplus \
msxml3 msxml6 \
mfc42 vcrun2005 vcrun2008 vcrun2010 vcrun2012 vcrun2013 \
d3dx9 d3dcompiler_43 quartz \
devenum \
vsm=3 \
fontsmooth=gray \
ddr=opengl \
Install-Module VSSetup -Scope CurrentUser