Skip to content

Instantly share code, notes, and snippets.

View killthekitten's full-sized avatar
🇺🇦

Nikolay Shebanov killthekitten

🇺🇦
View GitHub Profile

Unity Build Automation Setup with GameCI + itch.io

This covers the GitHub Actions setup for automating Unity builds with GameCI and deploying them to itch.io with butler. Two workflow files do the work; everything is manually triggered.

Overview

The build and upload steps are separate so you can build without deploying, or re-deploy an old build without rebuilding. The upload workflow is reusable it can be called by the build workflow or triggered manually.

As next steps, I plan connecting this to GitHub Releases so that every push/merge to the main branch generates a draft of release notes (ie. with a release drafter) and a build artifact, and all I'd have to do afterwards is simply edit the release notes and hit a button.

@killthekitten
killthekitten / README.md
Last active November 18, 2019 14:54
Showcase of a Flask-Admin 1.5.4 regression

Showcase of a Flask-Admin 1.5.4 regression

The sample code throws an error in Flask-Admin 1.5.3 when creating a user through the UI, but doesn't throw it in 1.5.4

More details you can find in the issue.

Before running, prepare the environment:

python -m venv venv
@killthekitten
killthekitten / main.py
Created June 9, 2019 12:18
flask run + DispatcherMiddleware demo
from flask import Flask
from werkzeug.middleware.dispatcher import DispatcherMiddleware
api = Flask("api")
admin = Flask("admin")
app = DispatcherMiddleware(api, {"/admin": admin})
@killthekitten
killthekitten / keep_proportion.py
Created April 9, 2019 12:10
Illustrates Pixmap regression introduced in PyMuPDF 1.14.13
import fitz
import io
import requests
PDF_URL = "https://github.com/pymupdf/PyMuPDF/raw/master/examples/colordbHSV.pdf"
PNG_URL = "https://www.onlygfx.com/wp-content/uploads/2018/07/12-grunge-brush-stroke-banner-11.png"
def handle(_):
pdf = requests.get(PDF_URL).content
@killthekitten
killthekitten / keep_proportion.py
Created April 3, 2019 07:29
Illustration of a bug (a feature?) in pyMuPDF
import fitz
import io
import requests
PDF_URL = "https://github.com/pymupdf/PyMuPDF/raw/master/examples/colordbHSV.pdf"
PNG_URL = "https://www.onlygfx.com/wp-content/uploads/2018/07/12-grunge-brush-stroke-banner-11.png"
def handle(_):
pdf = requests.get(PDF_URL).content
import fitz
import io
import requests
PDF_URL = "https://github.com/pymupdf/PyMuPDF/raw/master/examples/colordbHSV.pdf"
PNG_URL = "https://raw.githubusercontent.com/pymupdf/PyMuPDF/master/examples/hand.png"
def handle(_):
"""
@killthekitten
killthekitten / sgdregressor.py
Last active May 1, 2017 22:22
DIY SGDRegressor
class SGDRegressor(BaseEstimator):
def __init__(self, eta=10**-3, n_iter=10):
self.mse_ = []
self.weights_ = []
self.eta_ = eta
self.n_iter_ = n_iter
def fit(self, X, y):
X = self._prepend_ones(X)
current_w = np.zeros(X.shape[1], dtype=np.float64, order="C")
@killthekitten
killthekitten / persistent_csrf_token_cookie.rb
Last active October 6, 2021 17:12
Persistent CSRF token cookie
class BulkValidator
attr_accessor :items, :bulk_validations
def initialize(items, validations)
@items = items
@bulk_validations = build_bulk_validations(validations)
end
def candidates
bulk_validations.each do |validation|
class TariffSchemeFeeRule < ActiveRecord::Base
belongs_to :tariff_scheme
belongs_to :fee_rule
belongs_to :currency
validates :currency_id, uniqueness: { scope: [:fee_rule_id, :tariff_scheme_id] }, presence: true
end
class TariffScheme < ActiveRecord::Base
accepts_nested_attributes_for :tariff_scheme_fee_rules, allow_destroy: true