Skip to content

Instantly share code, notes, and snippets.

Avatar

Erik Körner Querela

  • Leipzig, Germany
View GitHub Profile
@Querela
Querela / grabVideoGenshinImpactCanvas.js
Created Jan 7, 2022
[JS] Save Genshin Impact Version Announcement Animated Canvas Video (Figures etc.)
View grabVideoGenshinImpactCanvas.js
// ex. https://webstatic-sea.mihoyo.com/ys/event/e20211227-pre/index.html?...
// get link from ingame messages (seem to contains some cookie/timestamp-key for which the URL is valid)
// credits to:
// - https://developers.google.com/web/updates/2016/10/capture-stream#demos
// - https://stackoverflow.com/a/34259326/9360161
// --- steps ---
// 1. open url/page normally
// 2. open dev tools
@Querela
Querela / idea.md
Created Nov 21, 2021 — forked from motorailgun/idea.md
Installing Windows and Linux into the same partition
View idea.md

Installing Windows and Linux into the same partition

But WHY?

There was a reddit post about installing Arch on NTFS3 partition. Since Windows and Linux doesn't have directories with same names under the /(C:\), I thought it's possible, and turned out it was actually possible.
If you are not familiar to Linux, for example you've searched on Google "how to dualboot Linux and Windos" or brbrbr... you mustn't try this. This is not practical.

Pre-requirements

  • UEFI system
  • Any Linux live-boot CD/DVD/USB... with Linux kernel newer than 5.15
  • Windows installer USB
@Querela
Querela / strsplit.sql
Created Aug 12, 2020 — forked from paulochf/strsplit.sql
MySQL split function: get nth splitted term from string separated value
View strsplit.sql
-- Retrieved from http://dev.mysql.com/doc/refman/5.6/en/string-functions.html at 2015-feb-10 18:16
-- Working on MySQL version 5.6.19-0ubuntu0.14.04.1 (Ubuntu)
--
-- Posted by Chris Stubben on August 21 2008 3:49pm
-- Split delimited strings
CREATE FUNCTION
strSplit(x VARCHAR(255), delim VARCHAR(12), pos INT) RETURNS VARCHAR(255)
return
REPLACE(SUBSTRING(SUBSTRING_INDEX(x, delim, pos),
@Querela
Querela / gist:4e16d944ad6ad8a91c98da7a50902e60
Created Aug 12, 2020 — forked from zzzeek/gist:a3bccad40610b9b69803531cc71a79b1
how to do CIDR overlapping in SQL with SQLite / MySQL / SQLAlchemy
View gist:4e16d944ad6ad8a91c98da7a50902e60
from sqlalchemy import event
from sqlalchemy import DDL
def _mysql_cidr_overlap(metadata):
@event.listens_for(metadata, "after_create")
def _create_mysql_proc(target, connection, **kw):
if connection.engine.name != 'mysql':
return
@Querela
Querela / readme.md
Created May 7, 2020
VSCode LatexWorkshop on WSL with MikTex for XeLaTeX
View readme.md

VSCode remote in WSL

  • with Latex Workshop
  • compiling XeLaTeX using MikTex

MikTex installation:

  • /mnt/c/miktex-portable/texmfs

Fonts in Windows

  • for use in WSL, but with MikTex on Windows, it is not really required :-/
  • see file: ~/.config/fontconfig/fonts.conf
View Palindrome.md
s = "abcdba"
all(f==e for f, in zip(s[0:len(s)//2:1], s[len(s):(len(s)-1)//2:-1]))
@Querela
Querela / docker-help.md
Created May 6, 2019 — forked from bradtraversy/docker-help.md
Docker Commands, Help & Tips
View docker-help.md

Docker Commands, Help & Tips

Show commands & management commands

$ docker

Docker version info

@Querela
Querela / navigation.pl
Created Feb 3, 2018 — forked from janesser/navigation.pl
navigation tree with prolog
View navigation.pl
child(n1, [n11, n12]).
child(n11, [c11, c2]).
child(n12, [c11]).
child(c1, [c11, c12]).
child(c11, [p111, p112]).
child(c12, [p112]).
% distributive
is_child(A, B) :- child(A,KIDS), member(B, KIDS).
@Querela
Querela / README.md
Created Aug 27, 2017 — forked from evandrix/README.md
Headless web browsers
View README.md

Here are a list of headless browsers that I know about:

  • [HtmlUnit][1] - Java. Custom browser engine. JavaScript support/DOM emulated. Open source.
  • [Ghost][2] - Python only. WebKit-based. Full JavaScript support. Open source.
  • [Twill][3] - Python/command line. Custom browser engine. No JavaScript. Open source.
  • [PhantomJS][4] - Command line/all platforms. WebKit-based. Full JavaScript support. Open source.
  • [Awesomium][5] - C++/.Net/all platforms. Chromium-based. Full JavaScript support. Commercial/free.
  • [SimpleBrowser][6] - .Net 4/C#. Custom browser engine. No JavaScript support. Open source.
  • [ZombieJS][7] - Node.js. Custom browser engine. JavaScript support/emulated DOM. Open source.
  • [EnvJS][8] - JavaScript via Java/Rhino. Custom browser engine. JavaScript support/emulated DOM. Open source.
View interruptable_region.py
import signal
class InterruptableRegion(object):
def __init__(self, sig=signal.SIGINT):
self.sig = sig
self.interrupted = False
self.released = False
self.original_handler = None
def __enter__(self):