Skip to content

Instantly share code, notes, and snippets.

View kyr0's full-sized avatar
hyperfocus

Aron Homberg kyr0

hyperfocus
  • Freelancer
  • Germany, remote
View GitHub Profile
@kyr0
kyr0 / enterprise_token.rb
Created November 26, 2025 16:24 — forked from markasoftware/enterprise_token.rb
OpenProject Enterprise mode for free
############ If you are using DOCKER all-in-one image, create Dockerfile like: ################
############ FROM openproject/openproject:16 ################
############ COPY ./enterprise_token.rb app/models/enterprise_token.rb ################
############ If you are runing a manual installation: ################
############ REPLACE app/models/enterprise_token.rb in the source code with this file! ################
############ also be sure to RESTART OpenProject after replacing the file. ################
############ If using some other set up (eg docker-compose), read the comments on ################
############ https://gist.github.com/markasoftware/f5b2e55a2c2e3abb1f9eefcdf0bfff45 ################
/**
* Base-12 Duodecimal Converter
* Custom digit set: 0, 1, 2, 3, 4, 5, Å, 6, №, 7, 8, 9
* Each digit represents values 0-11 respectively
*/
// Digit mapping: custom digit -> decimal value (0-11)
const DIGIT_TO_VALUE = {
'0': 0,
'1': 1,
@kyr0
kyr0 / pulsetest.cc
Created November 2, 2024 21:04 — forked from jasonwhite/pulsetest.cc
A simple PulseAudio test program for monitoring volume changes on the default sound sink.
/**
* Author: Jason White
* License: Public Domain
*
* Description:
* This is a simple test program to hook into PulseAudio volume change
* notifications. It was created for the possibility of having an automatically
* updating volume widget in a tiling window manager status bar.
*
* Compiling:
@kyr0
kyr0 / wp-node-timsort.js
Last active March 24, 2019 09:29
wp-node-timsort
'use strict';
const DEFAULT_MIN_MERGE = 32;
const DEFAULT_MIN_GALLOPING = 7;
const DEFAULT_TMP_STORAGE_LENGTH = 256;
const POWERS_OF_TEN = [1e0, 1e1, 1e2, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9]
const log10 = (x) => {
if (x < 1e5) {
if (x < 1e2) {
return x < 1e1 ? 0 : 1;
}
@kyr0
kyr0 / wp-node-quicksort.js
Created March 24, 2019 09:00
wp-node-quicksort
'use strict';
const quickSort = (arr, dimension, left = 0, right = arr.length - 1) => {
const len = arr.length; let index;
if (len > 1) {
index = partition(arr, dimension, left, right);
if(left < index - 1) quickSort(arr, dimension, left, index - 1);
if(index < right) quickSort(arr, dimension, index, right);
}
return arr;
};
@kyr0
kyr0 / wp-node.js
Created March 24, 2019 08:18
wp-node.js
'use strict';
const fs = require('fs');
const startTime = Date.now();
const log = (msg) => setImmediate(() => { process.stdout.write(msg); });
fs.readFile("/dev/stdin", 'utf8', (err, text) => {
const map = {}, sorted = [], lines = text.split("\n");
for (let i=0; i<lines.length; i++) {
const words = lines[i].split(' ');
for (let j=0; j<words.length; j++) {
if (words[j].length === 0) continue;
@kyr0
kyr0 / tab-hidden.directive.ts
Created June 26, 2017 18:44
Ionic 3 TabHiddenDirective to programmatically hide tabs using [tab-hidden]="true"; it is adaptive and also works fine on view changes
import {Directive, ElementRef, Input} from '@angular/core';
@Directive({ selector: '[tab-hidden]' })
export class TabHiddenDirective {
@Input('tab-hidden')
tabHidden: boolean;
private _tabElCache: Map<string, Element> = new Map();