Skip to content

Instantly share code, notes, and snippets.

View Stichoza's full-sized avatar
💻
Coding...

Levan Velijanashvili Stichoza

💻
Coding...
View GitHub Profile
@Stichoza
Stichoza / safari.css
Last active December 13, 2021 11:13
Safari style sheet hide news feed and right panel.
[role="main"] [data-pagelet="Stories"],
#ssrb_stories_end + div,
#ssrb_rhc_start + [data-pagelet="RightRail"],
[role="navigation"] [aria-label^="Watch"],
[role="navigation"] [aria-label^="Marketplace"],
[role="navigation"] [aria-label^="Gaming"],
[role="navigation"] [aria-label^="Home"],
[role="navigation"] [aria-label^="Groups"]
{
display: none !important;
@Stichoza
Stichoza / Flashing Sonoff with HomeKit.md
Last active June 22, 2022 20:14
Flashing Sonoff with HomeKit support

Flashing Sonoff with HomeKit support

Pre-requisites

  1. Install ESP Tool if you don't have it already.
  2. Download fullhaboot.bin file.

Flashing

  1. Connect serial adapter cable:
    1. 3.3v -> 3.3v
  2. RX -> TX
@Stichoza
Stichoza / pvm.sh
Created March 17, 2021 14:49
PHP version manager script for MAMP Pro
function pvm() {
if [ "$1" = "" ]; then
echo "Please specify PHP version to run."
return 1
elif [ "$1" = "use" ]; then
if [ "$2" = "" ]; then
echo "Please specify a PHP version."
return 1
elif test -f "/Applications/MAMP/bin/php/php$2/bin/php"; then
export PATH=/Applications/MAMP/bin/php/php$2/bin:$PATH
@Stichoza
Stichoza / A Backup File For IR Codes
Last active November 7, 2021 15:43
Broadlink RM Homebridge HEX Codes
IR Remote HEX codes for Broadlink RM devices
Original Plugin: https://github.com/lprhodes/homebridge-broadlink-rm
Better Fork: https://github.com/kiwi-cam/homebridge-broadlink-rm
IR Code Database: http://irdb.tk/find/
Covert Pronto HEX to LIRC: https://gist.github.com/rcarmo/a268972c6173acab8eaa59b56c8d6367
@Stichoza
Stichoza / ხელოსნები.md
Last active March 30, 2024 12:22
ხელოსნები
  • ელექტროობა, დიაგნოსტიკა - იურა 555566484 - დიღმის მასივში, ასტრა დიღომში;
  • ელექტროობა, დიაგნოსტიკა - ზაზა 599730481 - საბურთალოზე, შარტავაზე საბურთალოს ბაზრთან (ყოფილი) მშენებარე ობიექტია და იმ ტერიტორიაზეა. გვერდით სამრეცხაოც არის;
  • ელექტროობა, დიაგნოსტიკა - გურამი 593214435 - "ნახალოკაში";
  • ელექტროობა, დიაგნოსტიკა - იგორი - "Opel"-ის ყოფილ სერვის ცენტრში - ელიავაზე;
  • ელექტროობა - არტურა 599656090 - ორთაჭალაში სამშობიაროს რო გაცდები მარცხნივ მწვანე კარებია და მანდ მუშაობს;
  • ელექტროობა - არტურა 593223950 - მანქანაზე "პერებოის" გარანტიით გასწორება, შეუძლია შეამოწმოს ყველაფერი (მანქანა ცივი უნდა იყოს) - მუშაბს მარჯვენა სანაპიროზე, დიღმის მასივიდან რომ არის ჩასასვლელი, ბოქსებს დაინახავთ, მანდ სამრეცხაოებიც არის;
  • ელექტროობა - ნიკო და ზურა 599789053 - ველოტრეკზე (მერსედესის ცენტრამდე);
  • ელექტროობა, დიაგნოსტიკა Star C3-ის აპარატით - რობო 568775999 - დიდუბეში აკვაპარკის ჩასახვევში პირველივე პროფელაქტიკა;
  • ელექტროობა - ედიკა 599601454;
  • ელექტროობა - ზვიადი 599540517 - დიღომში ყოფილ ავტობაზრობასთან. მუშაობ

Two colors provide good color visibility if the brightness difference and the color difference between the two colors are greater than a set range.

Color brightness is determined by the following formula: ((Red value X 299) + (Green value X 587) + (Blue value X 114)) / 1000 Note: This algorithm is taken from a formula for converting RGB values to YIQ values. This brightness value gives a perceived brightness for a color.

Color difference is determined by the following formula: (maximum (Red value 1, Red value 2) - minimum (Red value 1, Red value 2)) + (maximum (Green value 1, Green value 2) - minimum (Green value 1, Green value 2)) + (maximum (Blue value 1, Blue value 2) - minimum (Blue value 1, Blue value 2))

The rage for color brightness difference is 125. The range for color difference is 500.

@Stichoza
Stichoza / cma-cgm-track.php
Created February 22, 2016 06:57
[TextBar] Show container tracking status (cma-cgm)
<?php
$data = file_get_contents('http://www.cma-cgm.com/ebusiness/tracking/search?SearchBy=Container&Reference=CONTAINER_NUMBER');
$exp = explode('class="date-current"', $data);
$exp = explode('data-move="status', $exp[1]);
preg_match('/(.+\>)(.+)(\<.+)/', $exp[1], $matches);
echo $matches[2];
@Stichoza
Stichoza / SayWinner.php
Created February 5, 2016 19:01
A small console command (php artisan winner) I wrote for generating a winner from attendees at Laravel meet-up.
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
class SayWinner extends Command
{
/**
* The name and signature of the console command.
@Stichoza
Stichoza / APP3null.scpt
Created February 4, 2016 06:35
APP3null scripts
set currentTime to current date
if the weekday of currentTime is Saturday or the weekday of currentTime is Sunday then
display notification "It's " & weekday of currentTime & "! Poor you!" with title "APP3null GmbH"
end if
set volume output volume 30
tell application "Mail" to activate

Keybase proof

I hereby claim:

  • I am Stichoza on github.
  • I am stichoza (https://keybase.io/stichoza) on keybase.
  • I have a public key whose fingerprint is 6EA1 57BC FB91 E8D9 938F 027F A50E C9A9 E4EC 7DBD

To claim this, I am signing this object: