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 / device_Rel2Abs.py
Last active November 3, 2024 05:24
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 / 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 / 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 / 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 / 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 / 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 / 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 / Streamliner_Going_CloseSource.md
Created July 31, 2022 05:42
Announcement of the cessation of the open source aspect of Streamliner, the custom hud for BallisticNG.

The BallisticNG code mod, Streamliner, was previously licensed under OSL-3.0 up to 1.2.10. Because not being able to get any help at all from the official discord server was really frustrating, and I didn't want that to happen again to anyone who wants to start making a custom hud. I thought having more publicly available source codes from more custom huds would help with that, so I wanted to state my intention with a license I carefully chose.1


One day, a member of the BallisticNG community sent me a DM, saying a friend of his wants to get permission to look at and use a part of my code that handles the hud motion for a custom hud the friend is making. I explained to him the license and the conditions for using my code. He then revealed that the friend is the guy working on WTRP, and it's

Footnotes

  1. The license allows using any parts of my codes adapted for your work, under the condition of licensing the work under the same license, which also requires you to disclose its source code. OSL 3.0 § 1(c)

@Dinir
Dinir / barometricpressureapp-doublecolumn.user.js
Last active December 30, 2022 10:56
Puts the two graphs in barometricpressure.app side by side.
// ==UserScript==
// @name Double Column for Barometric Pressure App Graphs
// @namespace dinir.works
// @version 1.0.0
// @description Puts the two graphs in barometricpressure.app side by side.
// @author Dinir Nertan
// @include /^https:\/\/barometricpressure\.app\/results\?.*/
// @icon https://www.google.com/s2/favicons?sz=64&domain=barometricpressure.app
// @grant none
// ==/UserScript==
@Dinir
Dinir / deleteSteamScreenshots.js
Last active March 11, 2022 21:31
mass delete Steam screenshots on your profile
/*
Go to your screenshot page, set view as Image Wall,
press F12, then go to console to paste this code.
The browser tab should be visible on the monitor.
I highly recommend moving them to a corner where you can't see
the screenshots as the page scrolls, as you won't see them ever again.
When the page eventually refreshes and says an error occured,
keep the page open until you see no more number changes on your profile.
*/