This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ############ 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 ################ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * 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, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * 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: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| '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; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| '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; | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| '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; |