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 / file-exists-ci.php
Created July 3, 2018 21:01 — forked from hubgit/file-exists-ci.php
Check if a file exists, with case-insensitive file name.
<?php
function file_exists_ci($file) {
if (file_exists($file))
return $file;
$lowerfile = strtolower($file);
foreach (glob(dirname($file) . '/*') as $file)
if (strtolower($file) == $lowerfile)
@salaros
salaros / cross-solar-dotnet_YaroslavZhmayev.patch
Created July 1, 2018 15:53
Patch for cross-solar-dotnet project
From 5e27d3e4b8896e7ad49afe19cd5426dc0c9fe106 Mon Sep 17 00:00:00 2001
From: salaros <[email protected]>
Date: Sun, 1 Jul 2018 18:50:14 +0300
Subject: [PATCH] My submission
XOV:v2
---
.../Controller/AnalyticsControllerTests.cs | 150 +++++++++++++++++++++
.../Controller/PanelControllerTests.cs | 38 +++++-
CrossSolar.Tests/CrossSolar.Tests.csproj | 3 +-
@salaros
salaros / dotnet-fall-back-on-mono.csproj
Last active June 17, 2018 16:05
A workaround for "full" .NET Framework targets to try to fallback on Mono before failing
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netstandard2.0;net40;net45;net471</TargetFrameworks>
</PropertyGroup>
<!-- A workaround for "full" .NET Framework targets to try to fallback on Mono before failing -->
<PropertyGroup Condition="'$(OS)' != 'Windows_NT' And $(TargetFramework.StartsWith('net'))">
<!-- Look up for Mono installations on Linux or macOS -->
<MonoPath Condition="'$(MonoPath)' == '' And Exists('/usr/lib/mono')">/usr/lib/mono</MonoPath>
@salaros
salaros / appveyor.yml
Last active June 5, 2018 21:03
AppVeyor + semantic versioning
# ...
environment:
VERSION_SIMPLE: '{version}'
VERSION_INFORMATIONAL: '{version}'
VERSION_UNSTABLE_SUFFIX: '-preview-$(APPVEYOR_BUILD_NUMBER)'
init:
- ps: .\scripts\init.ps1
@salaros
salaros / password_regex.txt
Last active May 8, 2018 20:03
A good regEx for validating secure passwords
(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[@\.\*\\\/,#$%`|\)\(\]\[=]).{6,25}
* min 6 max 25 characters
* at least one lower-case letter
* at least one upper-case letter
* at least one digit
* at least one "special" character, among these: , . * / \ # $ % ` [ ] ) (
#!/bin/sh
# Ms Office thumbnailer
# test Ubuntu distribution
DISTRO=$(lsb_release -is 2>/dev/null)
[ "${DISTRO}" != "Ubuntu" ] && { zenity --error --text="This automatic installation script is for Ubuntu only"; exit 1; }
# install tools
sudo apt-get -y install libfile-mimeinfo-perl gvfs-bin unoconv netpbm
@salaros
salaros / docker_cleanup.sh
Last active December 20, 2018 09:11
Clean up Docker images, containers etc
# Just clean up incomplete images
[[ ! -z $(docker images --filter "dangling=true" -q --no-trunc) ]] && \
docker rmi --force $(docker images --filter "dangling=true" -q --no-trunc)
#Remove unused containers
[[ ! -z $(docker ps -qa --no-trunc --filter "status=exited") ]] && \
docker rm $(docker ps -qa --no-trunc --filter "status=exited")
@salaros
salaros / .config__gtk-3.0__gtk.css
Created February 6, 2018 14:56
Tweak Nautilus desktop on Gnome Shell
.nautilus-desktop.nautilus-canvas-item {
color: #ffffff;
text-shadow: 1px 1px 2px rgba(25, 25, 25, 0.75), 1px 1px 2px rgba(25, 25, 25, 0.75);
}
@salaros
salaros / arduino-1.8.x-Ubuntu.sh
Created January 27, 2018 19:41
USB libraries needed by Arduino 1.8.x on Ubuntu
apt-get install libusb-0.1-4 libusb-0.1-4:i386
sudo apt install -y \
jbigkit-bin \
imagemagick \
ghostscript \
inotify-tools
wget https://github.com/xundeenergie/ricoh-sp100/raw/master/ricoh-sp100_0.1.10_all.deb
sudo dpkg -i ricoh-sp100_0.1.10_all.deb && rm -rfv ricoh-sp100_0.1.10_all.deb