Skip to content

Instantly share code, notes, and snippets.

View Dinir's full-sized avatar
🦽
Lost

Dinir Nertan Dinir

🦽
Lost
View GitHub Profile
@Dinir
Dinir / extractAudio.bat
Created August 9, 2022 15:07
Extract aac audio from a video file. Default audio track is 3 (0-index).
@echo off
set "inputfile=%1"
set "filename=%1"
shift
set track=3
:loop
if not "%1"=="" (
if "%1"=="-t" (
set "track=%2"
@Dinir
Dinir / naver-enkr.groovy
Last active January 12, 2023 10:57
OmegaT Browser plugin scripts for English-Korean translation works.
import org.omegat.core.Core
import org.omegat.core.CoreEvents
import org.omegat.core.events.IEditorEventListener
import org.omegat.gui.editor.IPopupMenuConstructor
import org.omegat.gui.editor.SegmentBuilder
import org.omegat.gui.main.MainWindow
import javax.swing.AbstractAction
import javax.swing.Action
import javax.swing.JComponent
@Dinir
Dinir / narrow-speller-cs-pusan.css
Last active January 11, 2023 10:38
Make the layout of the only reliable Korean spell checker suitable for a narrow and long area.
:root {
--margin: 7px;
--textarea-width: 85%;
}
body {
margin: 0;
overflow-x: hidden;
}
#framePopup {
@Dinir
Dinir / getWordsOfJSON.js
Created January 16, 2023 09:35
Extract values from JSON, so it can be used to get the wordcount.
const getWordsOfJSONObj = obj => {
let valueText = ''
for (key in obj) {
if (typeof obj[key] === 'object') {
valueText += getWordsOfJSONObj(obj[key])
} else {
valueText += obj[key] + '\n'
}
}
return valueText
@Dinir
Dinir / FuelEconomyConversion.txt
Last active February 18, 2023 05:47
for Google Sheets
=if(unit_index=unit_display_index,
fe_value,
if(unit_index=1,
let(
fe_value_in_kpl, 100/fe_value,
if(unit_display_index=2,
fe_value_in_kpl*KPLinMPGus,
if(unit_display_index=3,
fe_value_in_kpl*KPLinMPGi,
fe_value_in_kpl
@Dinir
Dinir / Double CC EN16 (Relative) 1.json
Last active October 23, 2024 01:33
2CC for each encoder, arranged for 90° Rotation.
{
"id": "c48454ff-b623-4460-a9eb-047a986304f0",
"modifiedAt": "2024-10-22T14:21:04.241Z",
"createdAt": "2024-10-20T09:13:08.235Z",
"name": "Double CC EN16 (Relative)",
"description": "CC numbers are assigned from `ccs` to 15 consecutive numbers. CC when pushed are assigned from `ccs+ccsh`. Numbers are by default aligned for 90° rotation. To change this, change `function er(eln)` in the System Setup Event.\n - for 0°, put `num+ccs`.\n - for 270°, change it to `(-4*(num+1))%17-1+ccs`.\n\nChange `cln`, `cld`, `clx`, and `clg` to apply different color. `cln` is for neutral, `cld` and `clx` are for turning left and right, `clg` is for button push.\n\nButton color by default is set to grey, so it doesn't affect encoder color and when pressed it just makes the color a bit brighter.",
"type": "EN16",
"version": {
"major": "1",
"minor": "3",
@Dinir
Dinir / device_Rel2Abs.py
Last active December 24, 2024 09:57
FL Studio can't process endless encoders. Here's a fallback making them into absolute encoders.
# name=Relative Value to Absolute Value
# Thanks to NFX (https://forum.image-line.com/viewtopic.php?t=329048#p1973274)
# and RoadCrewWorker (https://forum.image-line.com/viewtopic.php?t=328886#p1973550)
import device
import mixer
import midi
import ui
from fl_classes import FlMidiMsg
@Dinir
Dinir / user_defined_plugin_mappings.py
Created January 21, 2025 02:12
My Launchkey Plugin Mode Mappings for FL Studio - Goes to `%UserProfile%\Documents\Image-Line\FL Studio\Settings\Hardware\Novation\user\`.
user_defined_plugin_mappings = {
"plugin_mappings": [
{
"plugin_name": "3x Osc",
"parameters": [
{"parameter_index": 2, "name": "Osc 1 coarse pitch"},
{"parameter_index": 9, "name": "Osc 2 coarse pitch"},
{"parameter_index": 16, "name": "Osc 3 coarse pitch"},
{"parameter_index": 6, "name": "Osc 2 mix level"},
{"parameter_index": 13, "name": "Osc 3 mix level"},
@Dinir
Dinir / PlayerController.cs
Last active August 28, 2025 04:30
A Template to use with Input System Package in Unity Engine
using UnityEngine;
using UnityEngine.InputSystem;
public class PlayerController : MonoBehaviour
{
/*
* mov: stores movement data and related logic
* dir: stores direction data and related logic
* pos: (UI Map) stores mouse/pointer position data and related logic
* vel: stores vertical velocity value for gravity