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 / DNR-12x8.gpl
Last active April 2, 2022 11:29
My palette built with ColorBox.io.
GIMP Palette
Name: DNR-12x8
Columns: 8
# by Dinir Nertan using ColorBox
# https://github.com/Dinir
# https://www.colorbox.io/
#
0 0 0 #000000
255 255 0 #ffff00
255 0 255 #ff00ff
@Dinir
Dinir / ErrorLogCollector.js
Last active April 26, 2020 06:29
a small script that stores error logs somewhere accessible
class ErrorLogCollector {
constructor() {
/*
By putting it in an array, the log variable can be copied by reference.
And when attempted to display the whole array on a textarea
it will only show the text.
*/
this.errorLog = ['']
this.write = this.write.bind(this)
@Dinir
Dinir / template.html
Last active May 23, 2020 16:02
Default HTML template written using Velocity Template Language
#set( $MyName = "Dinir Nertan" )
#set( $MyTwitterHandle = "@DinirNertan" )
#set( $ThemeColor = "#65849f" )
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>#[[$1Title$]]#</title>
@Dinir
Dinir / HSVToRGB.js
Last active May 24, 2020 13:13
Colour Party
/**
* Convert HSV (0-360, 0-100, 0-100) to RGB (0-255 each)
* @param {number[]} hsv array containing hue, saturation, and value
* @returns {number[]} array containing value of each color
*
* @link https://en.wikipedia.org/wiki/HSL_and_HSV#HSV_to_RGB
* @link https://www.desmos.com/calculator/jhx7p5idov
*/
function HSVToRGB (hsv) {
// convert value range of saturation and value
@Dinir
Dinir / nightbot-sr.css
Created June 13, 2020 13:55
Show current track and requester name in a 320x58 area
/*
Size: Width 320, Height 400
Crop: Top 64, Bottom 278
*/
body { background-color: rgba(0, 0, 0, 0); margin: 0px; auto; overflow: hidden; }
/* transparent background */
.white-bg, .gray-bg, .breadcrumb { background-color: rgba(0, 0, 0, 0); }
div.row:nth-child(4) div, .table-striped > tbody > tr:nth-of-type(2n+1) {
background-color: rgba(0, 0, 0, 1);
@Dinir
Dinir / replaceStorage.js
Created January 26, 2021 20:43
Copy whole local storage to import it somewhere else.
const replaceStorage = doubleStringifiedStorage => {
// copy storage with `copy(JSON.stringify(JSON.stringify(window.localStorage)))`
window.localStorage.clear()
const imported = JSON.parse(doubleStringifiedStorage)
for (const n in imported) {
localStorage.setItem(n, imported[n])
}
}
@Dinir
Dinir / parse-query-parameters-into-a-map.js
Last active November 27, 2021 12:06 — forked from MatthewDaniels/parse-query-parameters-into-a-map.js
Parses a query parameter string into a javascript map. This script deals with multiple values by placing them into an array.
/**
* Get a query map based on a query string.
*
* The function will populate a map variable with key value pairs of the parameters.
*
* If there is more than one of the same key, the function will populate an array in the map with the multiple values within it.
*
* Forked from {@link https://gist.github.com/MatthewDaniels/388fa1e0c02613f103f00a504ed58c55 MatthewDaniels/parse-query-parameters-into-a-map.js}.
*
* @param {?string} [query=window.location.search] The query string - the question mark is optional
@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.
*/
@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 / 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)