Skip to content

Instantly share code, notes, and snippets.

View katyo's full-sized avatar

Kayo Phoenix katyo

View GitHub Profile
@katyo
katyo / git-subtreefy.sh
Last active June 9, 2023 16:27
Script for converting repo with recursive submodules to subtrees automatically
#!/usr/bin/env bash
# Usage:
# $ cd repo
# $ git-subtreefy.sh [subtree|subrepo]
function git_remote_by_url() {
for name in `git remote`; do
if [ "$1" == "`git remote get-url $name`" ]; then
printf $name
return 0
@katyo
katyo / README.md
Last active January 31, 2023 17:34
Teclast F5 onboard sound support for NixOS

To get onboard sound working on Teclast F5 with ES8336 codec we needs to use Linux kernel patches from SOF Project and the latest sof-firmware (v1.9).

On NixOS modify your configuration.nix like the following:

{ config, pkgs, lib, ... }:
{
 imports = [
{ pkgs, ... }:
{
fonts.fonts = [
(pkgs.callPackage ./gost-fonts.nix {})
];
}
@katyo
katyo / svd-dump.py
Created June 20, 2020 05:21 — forked from devanlai/svd-dump.py
gdb script for dumping STM32 registers
"""
Utilities for dumping STM32 peripheral registers with tab-completion
Based on a script by vampi-the-frog
Dependencies:
pip install -U cmsis-svd
Usage (inside gdb):
(gdb) source /path/to/svd-dump.py
@katyo
katyo / cpp2c.py
Last active November 26, 2020 06:43
import sys
import os
import re
from optparse import OptionParser
import ConfigParser
try:
import pygccxml
except ImportError:
@katyo
katyo / index.js
Last active December 4, 2018 08:35
rollup-plugin-visualizer crash when rollup-plugin-gzip used
export function main() {}
@katyo
katyo / bench.js
Last active February 23, 2017 22:15
Comparison of js string testing techniques
var allAttrs = ["abbr","accept","accept-charset","accesskey","action","alt","async","autocomplete","autocomplete","autofocus","autoplay","border","challenge","charset","charset","checked","cite","class","cols","colspan","content","contenteditable","controls","coords","crossorigin","data","datetime","datetime","default","defer","dir","dir","dirname","disabled","download","enctype","for","for","form","formaction","formenctype","formmethod","formnovalidate","formtarget","headers","height","hidden","high","href","href","href","hreflang","http-equiv","id","ismap","keytype","kind","label","lang","list","loop","low","manifest","max","max","maxlength","media","mediagroup","method","min","min","minlength","multiple","muted","name","name","name","name","name","name","novalidate","optimum","pattern","placeholder","poster","preload","readonly","rel","required","reversed","rows","rowspan","sandbox","spellcheck","scope","selected","shape","size","sizes","span","src","srcdoc","srclang","start","step","style","tabindex","tar
{options, config, lib, pkgs, ...}:
with lib;
let
cfg = config.webapp;
in {
## Interface ##
options.webapp = {
presets = mkOption {
default = {};
example = literalExample ''
@katyo
katyo / webapp.nix
Last active December 17, 2016 07:33
{options, config, lib, pkgs, ...}:
with lib;
let
cfg = config.webapp;
in {
## Interface ##
options.webapp = {
presets = mkOption {
default = {};
example = literalExample ''
@katyo
katyo / .gitignore
Last active November 25, 2015 15:49
UglifyJS clossure variables overlapping
node_modules/
dist/