Skip to content

Instantly share code, notes, and snippets.

View HKGx's full-sized avatar
👀

Hubert HKGx

👀
  • Poland
View GitHub Profile

Keybase proof

I hereby claim:

  • I am hkgx on github.
  • I am hkgx (https://keybase.io/hkgx) on keybase.
  • I have a public key ASC5YQw0Zk8tk3bvylr9vgMN92vAR-eYXeglTYZhNt76mgo

To claim this, I am signing this object:

@HKGx
HKGx / script.user.js
Created May 13, 2020 21:50
testportal omit focus thingy lol
// ==UserScript==
// @name New Userscript
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://www.testportal.pl/exam/*
// @grant unsafeWindow
// ==/UserScript==

Introduction

I've competed in Google Code-In and I spotted a neat task from CCExtractor.

Task's title was "How can we identify movies based on scenes in them?" and I'm going to answer that question.

First thoughts

The first thing that came to my mind was to split a video into frames using FFmpeg. After splitting we perhaps could test our input against those frames.

But that's a disastrous idea!

@HKGx
HKGx / overcomplicated_rock_paper_scissors.jl
Last active December 31, 2019 08:37
Rock paper scissors made for CGI 2019.
yay_or_nay(v::Bool, y::Function, n::Function) = v ? y : n
p1_score = 0
p2_score = 0
function did_end()
return yay_or_nay(p1_score >= 3, () -> true, () -> yay_or_nay(p2_score >= 3, () -> true, () -> false)())()
end
function get_winner()
@HKGx
HKGx / discord_emojis.py
Created September 8, 2019 18:55
the entire (i think) list of discord emojis parsed to work as python dict
{
",:(": "\U0001f613",
",:)": "\U0001f605",
",:-(": "\U0001f613",
",:-)": "\U0001f605",
",=(": "\U0001f613",
",=)": "\U0001f605",
",=-(": "\U0001f613",
",=-)": "\U0001f605",
"0:)": "\U0001f607",
function getUserFromMentionRegExWithLengthCheck(mention) {
const matches = mention.match(/^<@!?(\d{18})>$/);
if (!matches) return;
const id = matches[1];
return users.get(id);
}
@HKGx
HKGx / pipe.py
Last active April 7, 2019 20:54
Simple piping system for Python3. Idea borrowed (of course) from functional languages. Supports async.
from typing import Callable, Any
"""
>>> (P(2) | P(lambda x: x**2) | P(lambda y: y**4))()
256
>>> pipe = (P(2) | P(lambda x: x**2) | P(lambda y: y**4))
>>> pipe.arg
256
@HKGx
HKGx / █▬█ █ ▀█▀.user.js
Last active April 23, 2020 17:13
Make every discount on steam a █▬█ █ ▀█▀
// ==UserScript==
// @name █▬█ █ ▀█▀
// @namespace https://github.com/HKGx
// @version 1.1
// @description Make every discount a █▬█ █ ▀█▀
// @author HKG
// @match https://store.steampowered.com/*
// @grant none
// @downloadURL https://gist.github.com/HKGx/7958a6d18d1128ae4dd5f5e365ab5094/raw/65d7756558257ff440a4843a90f825ef0970e789/█▬█ █ ▀█▀.user.js
// @updateURL https://gist.github.com/HKGx/7958a6d18d1128ae4dd5f5e365ab5094/raw/65d7756558257ff440a4843a90f825ef0970e789/█▬█ █ ▀█▀.user.js
@HKGx
HKGx / ContentType.cs
Created November 24, 2018 22:23
Full list of mime-types. Extracted directly from https://www.iana.org/assignments/media-types/media-types.xhtml Some of them are empty, idk why.
using System.Reflection;
namespace ServerMeWell.Mime
{
public enum ContentType
{
[MimeMeta("application/1d-interleaved-parityfec")] D_INTERLEAVED_PARITYFEC,
[MimeMeta("application/3gpdash-qoe-report+xml")] GPDASH_QOE_REPORT_XML,
[MimeMeta("application/3gpp-ims+xml")] GPP_IMS_XML,
@HKGx
HKGx / Facebook Hidden Reactions.user.js
Last active July 31, 2018 19:16
fixed some ids lul
// ==UserScript==
// @name Facebook Hidden Reactions
// @description Adds new hidden reactions
// @match *://*.facebook.com/*
// @version 1.1
// @grant none
// @run-at document-body
// ==/UserScript==
//
// Original code: https://p0358.net/facebook_reactions.user.js