Skip to content

Instantly share code, notes, and snippets.

View unkray's full-sized avatar
🏢
Working

Andrew Sh. unkray

🏢
Working
View GitHub Profile
@unkray
unkray / .editorconfig
Last active August 29, 2025 05:41
.editorconfig
# Editor configuration, see https://editorconfig.org
root = true
[*]
charset = utf-8
end_of_line = lf
indent_style = space
indent_size = 4
insert_final_newline = true
trim_trailing_whitespace = true
@unkray
unkray / 2019-https-localhost.md
Created March 30, 2022 13:37 — forked from cecilemuller/2019-https-localhost.md
How to create an HTTPS certificate for localhost domains

How to create an HTTPS certificate for localhost domains

This focuses on generating the certificates for loading local virtual hosts hosted on your computer, for development only.

Do not use self-signed certificates in production ! For online certificates, use Let's Encrypt instead (tutorial).

@unkray
unkray / gist:48ef509e6bb78372b246c5f7cada42aa
Created June 16, 2021 06:13 — forked from jfernandes-dtm/gist:319f9d9233e1783dc41ccb836a0c5d47
Nginx, PHP-FPM, MySQL and phpMyAdmin on OS X

This is my take on how to get up and running with NGINX, PHP-FPM, MySQL and phpMyAdmin on OSX Yosemite.

This article is adapted from the original by Jonas Friedmann. Who I just discovered is from Würzburg in Germany. A stonesthrow from where I was born ;)

Xcode

Make sure you have the latest version of XCode installed. Available from the Mac App Store.

Install the Xcode Command Line Tools:

xcode-select --install

@unkray
unkray / sources.list
Created March 1, 2021 18:56 — forked from ishad0w/sources.list
Ubuntu 20.04 LTS (Focal Fossa) -- Full sources.list
deb http://archive.ubuntu.com/ubuntu/ focal main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ focal main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ focal-updates main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ focal-updates main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ focal-security main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ focal-security main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ focal-backports main restricted universe multiverse
@unkray
unkray / emoji_entitizer.php
Created December 27, 2020 08:26
Convert emojis in a string to html entities.
function emoji_entitizer($str) {
$emoji_pattern = "/\\x{1F469}\\x{200D}\\x{2764}\\x{FE0F}\\x{200D}\\x{1F48B}\\x{200D}\\x{1F469}|\\x{1F469}\\x{200D}\\x{2764}\\x{FE0F}\\x{200D}\\x{1F48B}\\x{200D}\\x{1F468}|\\x{1F468}\\x{200D}\\x{2764}\\x{FE0F}\\x{200D}\\x{1F48B}\\x{200D}\\x{1F468}|\\x{1F469}\\x{200D}\\x{1F469}\\x{200D}\\x{1F466}\\x{200D}\\x{1F466}|\\x{1F468}\\x{200D}\\x{1F468}\\x{200D}\\x{1F467}\\x{200D}\\x{1F466}|\\x{1F469}\\x{200D}\\x{1F469}\\x{200D}\\x{1F467}\\x{200D}\\x{1F467}|\\x{1F469}\\x{200D}\\x{1F469}\\x{200D}\\x{1F467}\\x{200D}\\x{1F466}|\\x{1F468}\\x{200D}\\x{1F469}\\x{200D}\\x{1F467}\\x{200D}\\x{1F467}|\\x{1F468}\\x{200D}\\x{1F469}\\x{200D}\\x{1F467}\\x{200D}\\x{1F466}|\\x{1F468}\\x{200D}\\x{1F469}\\x{200D}\\x{1F466}\\x{200D}\\x{1F466}|\\x{1F468}\\x{200D}\\x{1F468}\\x{200D}\\x{1F467}\\x{200D}\\x{1F467}|\\x{1F468}\\x{200D}\\x{1F468}\\x{200D}\\x{1F466}\\x{200D}\\x{1F466}|\\x{1F3CC}\\x{FE0F}\\x{200D}\\x{2640}\\x{FE0F}\\x{1F3FB}|\\x{1F3CB}\\x{FE0F}\\x{200D}\\x{2640}\\x{FE0F}\\x{1F3FF}|\\x{1F575}\\x{FE
@unkray
unkray / .gitlab-ci.yml
Last active December 14, 2020 07:44 — forked from shaliko/.gitlab-ci.yml
GitLab Continuous Integration with Capistrano 3
# Take valid private key for $SSH_PRIVATE_KEY variable to the agent store
# cat .ssh/id_rsa | base64 -w0 >> ./deploy_key
image: ruby:2.6
stages:
- deploy
deploy_testing:
environment:
@unkray
unkray / polygon.php
Last active April 30, 2020 16:53
Belonging to the point of the polygon / Принадлежность точки к полигону
<?php
class Polygon {
var $pointOnVertex = true; // Check if the point sits exactly on one of the vertices?
function pointLocation() {
}
function pointInPolygon($point, $polygon, $pointOnVertex = true) {
@unkray
unkray / Default controller CI3.md
Last active June 3, 2019 05:00
Default controller inside subfolder for codeigniter 3

By default, you are not allowed to do that. To get around this, you need to hack your system Router.php:

codeigniter/system/core/Router.php

Edit a few lines of code so that it becomes like this:

codeigniter/system/router.php

line 1. if (!sscanf($this->default_controller, '%[^/]/%[^/]/%s', $directory, $class, $method) !== 2)

@unkray
unkray / Ubuntu_Opera_HTML5-video.md
Last active April 22, 2019 04:36
Ubuntu Opera HTML5-video

Исправление ошибки с воспроизведением HTML5-видео в Opera / Fixed a bug with playing HTML5 video in Opera

$ sudo apt install -f chromium-codecs-ffmpeg-extra

$ cd /usr/lib/x86_64-linux-gnu/opera

$ sudo ln -sf /usr/lib/chromium-browser/libffmpeg.so libffmpeg.so

@unkray
unkray / sources.list
Last active April 20, 2019 15:51
Ubuntu 18.04 Bionic default /etc/apt/sources.list
#deb cdrom:[Ubuntu 18.04 LTS _Bionic Beaver_ - Release amd64 (20180426)]/ bionic main restricted
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://ru.archive.ubuntu.com/ubuntu/ bionic main restricted
# deb-src http://ru.archive.ubuntu.com/ubuntu/ bionic main restricted
## Major bug fix updates produced after the final release of the
## distribution.
deb http://ru.archive.ubuntu.com/ubuntu/ bionic-updates main restricted