Skip to content

Instantly share code, notes, and snippets.

View D-side's full-sized avatar

Pavel Peganov D-side

View GitHub Profile
@D-side
D-side / .env
Last active March 5, 2022 19:22
Kiwix-serve: quick start
KIWIX_FILES=/path/to/zim/files
KIWIX_PORT=2080
@D-side
D-side / build_translations.js
Created February 3, 2019 03:04
Subnautica translation builder (for the browser console; sample values set for Russian)
// You need to be logged in on translate.unknownworlds.com in order to use this script
// "https://translate.unknownworlds.com/api/base-strings?project_id=9"
// "https://translate.unknownworlds.com/api/strings?project_id=9&language_id=5"
let filename = "Russian.json";
let project_id = 9;
let language_id = 5;
responses = Promise.all([
fetch(`/api/base-strings?project_id=${project_id}`).then(r => r.json()),
@D-side
D-side / dsu.rb
Created July 9, 2014 07:36
Primitive Ruby Disjoint-Set
class DSU
def initialize(x)
@array = Array.new(x) {|i| i }
end
def find(x)
return x if @array[x] == x
@array[x] = find(@array[x])
end
// Jekyll Pygments syntax highlighter styles
// Color scheme
$base03: #002B36
$base02: #073642
$base01: #586E75
$base00: #657B83
$base0: #839496
$base1: #93A1A1
$base2: #EEE8D5