Skip to content

Instantly share code, notes, and snippets.

View XCanG's full-sized avatar
💾
do impossible, beat unbeatable

XCanG XCanG

💾
do impossible, beat unbeatable
View GitHub Profile
@XCanG
XCanG / imageborders image conent.css
Last active October 11, 2017 16:44
Make images at full size when hover on it. Used in Stylus/Stylish.
@-moz-document domain("gelbooru.com"), domain("konachan.com"), domain("danbooru.donmai.us"), domain("yande.re"), domain("chan.sankakucomplex.com"), domain("zerochan.net"), domain("idol.sankakucomplex.com"), domain("sakugabooru.com") {
#image, #fullsize img {
transition: .15s ease-in-out;
}
/* Gelbooru, Danbooru, Konachan, Sankakucomplex, yande.re, Sakugabooru */
#image:hover, #gelcomVideoPlayer:hover, #post-view video:hover {
position: fixed;
top: 1px;
left: 226px;
max-height: unset !important;
@XCanG
XCanG / glsl-infinite-voronoi-zoom.markdown
Created February 1, 2018 21:03
GLSL: Infinite Voronoi Zoom

GLSL: Infinite Voronoi Zoom

First try at (quasi) infinite zoom in GLSL.

Using a standard voronoi pattern over a series of layers and then simply looping through time and space. I need to explore this technique a lot more.

I would appreciate it, if you end up using this code in any sort of production situation, that you cite me in your code and let me know what you've used it for. I love seeing that people actually get use out of the things that I write, and I don't think it's too much to ask that I get a citation for my troubles :)

A Pen by Liam Egan on CodePen.

/* Messages padding */
.jss5672:last-child {
padding: 2px;
}
/* Messages wrap with semitransparent bg */
.jss5671 {
border-radius: 4px;
background-color: rgba(37, 56, 88, .25) !important;
transition: background-color .2s ease;
@XCanG
XCanG / index.pug
Created August 14, 2019 18:59
Test template with basis of 1024px list
div.container
- for (let i = 0; i<10; i++)
div.element
div.content 1
div.controls 2
@XCanG
XCanG / keybase.md
Created October 12, 2019 09:22
Keybase proof

Keybase proof

I hereby claim:

  • I am XCanG on github.
  • I am xcang (https://keybase.io/xcang) on keybase.
  • I have a public key whose fingerprint is EA77 643D 3316 D3ED C741 186E DE82 178A B32C 3331

To claim this, I am signing this object:

@XCanG
XCanG / .markdown
Created December 17, 2019 20:13
Обратный отсчёт
@XCanG
XCanG / FastAPI.md
Created January 28, 2020 09:56
Рассмотр фреймворка FastAPI

FastAPI

FastAPI - новый фреймворк для создания REST API, ориентированный на скорость работы, удобство разработки, интуитивность, простоту использования, наличие дополнительного функционала, уменьшающего объём кода и следование стандартам (OpenAPI, JSON Schema).

FastAPI построен на основе Starlette, ASGI мифкрофреймворка, и имеет схожую с ним скорость работы и Pydantic, библиотеки для парсинга и валидации данных на основе типизации (type hinting), встроенной в Python.

FastAPI также автоматически создаёт документацию посредством библиотек Swagger и ReDoc.

Производительность

@XCanG
XCanG / dict_pairs_to_tree.py
Created January 30, 2020 10:50
Convert dict pairs to dict tree
source = [
(None, 'a'),
(None, 'b'),
(None, 'c'),
('a', 'a1'),
('a', 'a2'),
('a2', 'a21'),
('a2', 'a22'),
('b', 'b1'),
('b1', 'b11'),
@XCanG
XCanG / print_numbers.py
Last active September 26, 2020 16:15
This module generate float range of numbers. Run script either with double click, it will prompt for input, or from console like that or without arguments: python print_numbers.py <from> <to> [step] [acceleration]
#!python
import sys
import os
def print_numbers(start, end, step = .1, acceleration = .0):
if end < start and step > 0.:
start, end = end, start
if start < end and step < 0.:
start, end = end, start
@XCanG
XCanG / HonkaiImpact3rd_HumanControl.ahk
Created July 12, 2021 05:51
AutoHotKey script for Honkai Impact 3rd for Human Control, supporting mouse and better keybindings. Read comments (after ;) in file itself.
#MaxHotkeysPerInterval 200
SetKeyDelay, 20, 10, Play
;Honkai Impact 3rd
#IfWinActive ahk_exe BH3.exe
~*LButton::j ; Attack
~*LAlt::j ; Attack (no pass direction)
*MButton::i ; Ultimate
*RButton::u ; Weapon skill
XButton1::` ; Back menu
XButton2::LButton ; Camera overview