Skip to content

Instantly share code, notes, and snippets.

@gordinmitya
gordinmitya / gpu_compatibility.json
Created December 2, 2022 13:01
TFLite gpu compatibility database at state 7b3867c
{
"root": [
{
"variable": "tflite.opengl_es_version",
"items": [
{
"value": "3.1",
"children": [
{
"variable": "tflite.gpu_model",
#include <stdio.h>
#include <getopt.h>
#include <stdlib.h>
#include <string.h>
struct flags
{
int b, e, n, s, t, u, v;
} f = {0};
import java.util.*
fun doit(array: CharArray, left: Int, balance: Int) {
if (left == 0) {
println(Arrays.toString(array))
return
}
if (left > balance) {
array[array.size - left] = '('
doit(array, left - 1, balance + 1)
@gordinmitya
gordinmitya / pong.c
Created June 26, 2022 09:49
Ping-pong console game
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <stdbool.h>
#include <time.h>
#include <sys/select.h>
#include <string.h>
#define MIN(a, b) (((a) < (b)) ? (a) : (b))
#define MAX(a, b) (((a) > (b)) ? (a) : (b))
@gordinmitya
gordinmitya / .wezterm.lua
Created June 19, 2022 08:22
github.com/wez/wezterm config
-- ~/.wezterm.lua
local wezterm = require 'wezterm';
return {
keys = {
{key="w", mods="CMD", action=wezterm.action{CloseCurrentPane={confirm=true}}},
{key="d", mods="CMD", action=wezterm.action{SplitVertical={domain="CurrentPaneDomain"}}},
{key="d", mods="CMD|SHIFT", action=wezterm.action{SplitHorizontal={domain="CurrentPaneDomain"}}},
},
window_decorations = "RESIZE",
@gordinmitya
gordinmitya / CameraActivity.kt
Created December 2, 2020 22:10
android/camera-samples measurements for YUV conversion
/*
* Copyright 2020 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@gordinmitya
gordinmitya / config
Last active June 22, 2023 14:43
Fix terminator tab size
# ~/.config/terminator/config
[global_config]
scroll_tabbar = True
[keybindings]
switch_to_tab_1 = <Alt>1
switch_to_tab_2 = <Alt>2
switch_to_tab_3 = <Alt>3
switch_to_tab_4 = <Alt>4
switch_to_tab_5 = <Alt>5
@gordinmitya
gordinmitya / factorio_headless_guide.md
Created November 22, 2020 12:53 — forked from othyn/factorio_headless_guide.md
How to setup a Factorio Headless Server

[LINUX] Factorio Headless Server Guide

So, with credit to the Factorio wiki and cbednarski's helpful gist, I managed to eventually setup a Factorio headless server. Although, I thought the process could be nailed down/simplified to be a bit more 'tutorialised' and also to document how I got it all working for my future records.

The specific distro/version I'm using for this guide being Ubuntu Server 16.04.1 LTS. Although, that shouldn't matter, as long as your distro supports systemd (just for this guide, not a Factorio headless requirement, although most distros use it as standard now). The version of Factorio I shall be using is 0.14.20, although should work for any version of Factorio 0.14.12 and higher.

Alternate

If you prefer a simple, automated setup, [Bisa has a really handy init script that will do most of the work for

@gordinmitya
gordinmitya / rgb2ycbcr.py
Created October 26, 2020 11:09
rgb, ycbcr, opencv, numpy, skimage
import numpy as np
import cv2
import skimage.color
import torch
rgb2ycbcr = np.array([[65.481, 128.553, 24.966],
[-37.797, -74.203, 112.0],
[112.0, -93.786, -18.214]]).T
# from scipy import linalg
@gordinmitya
gordinmitya / MovingAvg.java
Created July 15, 2020 19:32
Moving average for performance measurements in Java
public class MovingAvg {
public final long[] measurements;
public final int size;
private int pointer = 0;
public MovingAvg(int size) {
measurements = new long[size];
this.size = size;
}