Skip to content

Instantly share code, notes, and snippets.

View Fedik's full-sized avatar
🐢

Fedir Zinchuk Fedik

🐢
  • Ukraine
View GitHub Profile
@Fedik
Fedik / php-8.1-strftime.php
Created December 25, 2021 08:36 — forked from bohwaz/php-8.1-strftime.php
strftime() replacement function for PHP 8.1
<?php
namespace PHP81_BC;
/**
* Locale-formatted strftime using IntlDateFormatter (PHP 8.1 compatible)
* This provides a cross-platform alternative to strftime() for when it will be removed from PHP.
* Note that output can be slightly different between libc sprintf and this function as it is using ICU.
*
* Usage:
* use func \PHP81_BC\strftime;
@Fedik
Fedik / youtubemusicdownloader.py
Created June 21, 2021 16:00 — forked from un1tz3r0/youtubemusicdownloader.py
This script uses ytmusicapi and pytube together to download your playlists, history or 'liked' songs as high-quality audio-only streams from Youtube Music.
''' This script uses ytmusicapi and pytube together to download your playlists, history or 'liked' songs as
high-quality audio-only streams from Youtube Music, which are protected by a "signatureCipher" obfuscation scheme.
To use it, first install [ytmusicapi] and [pytube] using pip, then follow the instructions for creating the auth
file from the response in an authenticated session to a watch-page request as found in your browser's dev-tools.
The downloaded files are placed in ~/Music, named with the artist and track metadata, and will be skipped instead
of downloaded again next time it is run, based on the videoIds of the downloaded songs.
Merry Xmas - V.
@Fedik
Fedik / genymotionwithplay.txt
Created October 28, 2018 19:20 — forked from wbroek/genymotionwithplay.txt
Genymotion with Google Play Services for ARM
NOTE: Easier way is the X86 way, described on https://www.genymotion.com/help/desktop/faq/#google-play-services
Download the following ZIPs:
ARM Translation Installer v1.1 (http://www.mirrorcreator.com/files/0ZIO8PME/Genymotion-ARM-Translation_v1.1.zip_links)
Download the correct GApps for your Android version:
Google Apps for Android 6.0 (https://www.androidfilehost.com/?fid=24052804347835438 - benzo-gapps-M-20151011-signed-chroma-r3.zip)
Google Apps for Android 5.1 (https://www.androidfilehost.com/?fid=96042739161891406 - gapps-L-4-21-15.zip)
Google Apps for Android 5.0 (https://www.androidfilehost.com/?fid=95784891001614559 - gapps-lp-20141109-signed.zip)
@Fedik
Fedik / a_mysqldiff.md
Created December 2, 2017 14:23
MySQL - Identify Differences Among Databases
@Fedik
Fedik / 51-these-are-not-joysticks.rules
Created October 28, 2017 09:06 — forked from denilsonsa/51-these-are-not-joysticks.rules
Fix for keyboard/mouse/tablet being detected as joystick in Linux — Moved to https://github.com/denilsonsa/udev-joystick-blacklist
#
# ███╗ ███╗ ██████╗ ██╗ ██╗███████╗██████╗ ████████╗ ██████╗
# ████╗ ████║██╔═══██╗██║ ██║██╔════╝██╔══██╗ ╚══██╔══╝██╔═══██╗
# ██╔████╔██║██║ ██║██║ ██║█████╗ ██║ ██║ ██║ ██║ ██║
# ██║╚██╔╝██║██║ ██║╚██╗ ██╔╝██╔══╝ ██║ ██║ ██║ ██║ ██║
# ██║ ╚═╝ ██║╚██████╔╝ ╚████╔╝ ███████╗██████╔╝ ██║ ╚██████╔╝
# ╚═╝ ╚═╝ ╚═════╝ ╚═══╝ ╚══════╝╚═════╝ ╚═╝ ╚═════╝
#
# ╔═════════════════════════════════════════════════════════════════╗
# ║ https://github.com/denilsonsa/udev-joystick-blacklist ║
@Fedik
Fedik / markdown_doc
Last active August 2, 2023 16:30 — forked from jiffyclub/markdown_doc
Turn Markdown into HTML using Python markdown library and wraps the result in a complete HTML document with default Bootstrap styling. Requires the python libraries markdown.
#!/usr/bin/env python
import argparse, sys, markdown
TEMPLATE = """<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="referrer" content="no-referrer" />
<meta name="referrer" content="unsafe-url" />
/**
* BIC is the business identifier code (ISO 9362). This BIC check is not a guarantee for authenticity.
*
* BIC pattern: BBBBCCLLbbb (8 or 11 characters long; bbb is optional)
*
* BIC definition in detail:
* - First 4 characters - bank code (only letters)
* - Next 2 characters - ISO 3166-1 alpha-2 country code (only letters)
* - Next 2 characters - location code (letters and digits)
* a. shall not start with '0' or '1'
@Fedik
Fedik / Function.Date-Format-Conversion.php
Created October 23, 2016 12:06 — forked from mcaskill/Function.Date-Format-Conversion.php
PHP : Translate date/time format between `date()` and `strftime()`
<?php
/**
* Convert date/time format between `date()` and `strftime()`
*
* Timezone conversion is done for Unix. Windows users must exchange %z and %Z.
*
* Unsupported date formats : S, n, t, L, B, G, u, e, I, P, Z, c, r
* Unsupported strftime formats : %U, %W, %C, %g, %r, %R, %T, %X, %c, %D, %F, %x
*
@Fedik
Fedik / EventMonitor.js
Created January 26, 2016 12:04 — forked from livingston/EventMonitor.js
Element event monitor, similar to Web Inspector's `monitorEvents`
(function (global) {
if ( !global.Event && !('keys' in Object) && !('bind' in Function) ) { return }
var eventProto = Event.prototype,
EVENTS = {
'mouse': [ 'click', 'dblclick', 'contextmenu', 'mousedown', 'mouseup', 'mouseover', 'mousemove', 'mouseout', 'drag', 'dragend', 'dragenter', 'dragleave', 'dragover', 'drop'],
'key': [ 'keydown', 'keypress', 'keyup', 'input'],
'res': [ 'load', 'unload', 'beforeunload', 'abort', 'error', 'resize', 'scroll', 'readystatechange' ],
'form': [ 'select', 'change', 'submit', 'reset', 'focus', 'blur' ],
'ui': [ 'DOMFocusIn', 'DOMFocusOut', 'DOMActivate', 'DOMCharacterDataModified', 'DOMNodeInserted', 'DOMNodeRemoved', 'DOMSubtreeModified' ],
@Fedik
Fedik / js.class.js
Last active December 29, 2015 16:18
JavaScript raw has/add/remove Class
Element.prototype.hasClassName = function(className) {
return this.classList ? this.classList.contains(className) : !!this.className.match(new RegExp('(\\s|^)' + className + '(\\s|$)'));
}
Element.prototype.addClass = function(className) {
if (this.classList){this.classList.add(className);}
else if (!this.hasClass(className)){this.className += " " + className;}
return this;
}
Element.prototype.removeClass = function(className) {
if (this.classList){this.classList.remove(className);}