Skip to content

Instantly share code, notes, and snippets.

View goooseman's full-sized avatar
🦇
This is bat country!

Alexander Gusman goooseman

🦇
This is bat country!
View GitHub Profile
libraryA from ‘library-a’;
const bar = new libraryB.Bar(document.body, { withTicks: true });
@goooseman
goooseman / ук-рф-parser.ts
Created July 5, 2020 23:11
Парсер УК РФ в структуру типа `{"Раздел 1": {"Глава 1": {"Статья 1": "http://consultant.ru/1"}}}`
import { JSDOM, ResourceLoader } from "jsdom";
import fs from "fs";
import path from "path";
const USER_AGENT =
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36";
interface Result {
[key: string]: string | Result;
}
@goooseman
goooseman / excel-remove-columns.js
Created January 29, 2020 17:18
Node.js script to mass remove columns from a bunch of Excel files
const XLSX = require("xlsx");
const glob = require("glob");
const path = require("path");
let i = 0;
glob
.sync(path.join(__dirname, "./original/*.xlsx"))
.forEach(function(file) {
// tslint:disable-next-line: non-literal-require
@goooseman
goooseman / gopro-quik-converter.sh
Last active December 31, 2019 12:22
Convert any .mp4 video to be used in DJI Quik software
#!/bin/bash
# Based on https://riviera.org.uk/2018/10/23/importing-non-gopro-videos-into-gopro-quik/
if [ -d "$1" ]
then
mkdir "$1/GoPro Quik"
for filename in "$1"/*.mp4; do
filename_base=$(basename "$filename")
ffmpeg -i "$filename" \
@goooseman
goooseman / Dockerfile-kops
Created December 9, 2019 16:32
A Dockerfile to build a Docker image with kubectl and kops. Hosted at trucknet/kops
# Taken from https://github.com/kubernetes/kops
# Copyright 2017 The Kubernetes Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
@goooseman
goooseman / gitlab-wider-env.user.js
Last active November 7, 2019 13:08
GreaseMonkey / Makes environment variables wider in GitLab CI
// ==UserScript==
// @name GitLab Wider Env
// @description Makes environment variables inputs wider in GitLab's CI/CD settings (https://gitlab.com/*/settings/ci_cd)
// @version 1
// @match https://gitlab.com/*/ci_cd
// @grant none
// ==/UserScript==
for (const el of document.querySelectorAll(".container-fluid.container-limited.limit-container-width")) {
@goooseman
goooseman / Dockerfile-docker-awscli
Last active December 9, 2019 16:33
Docker image of Docker-in-Docker with awscli installed
FROM docker:stable
RUN apk add --no-cache python3
RUN pip3 install awscli
@goooseman
goooseman / kinopub-speedtest
Created January 19, 2019 16:47
Source file of speedtest client on kino.pub/speed
/*
HTML5 Speedtest v4.3.2
by Federico Dossena
https://github.com/adolfintel/speedtest/
GNU LGPLv3 License
*/
// data reported to main thread
var testStatus = 0 // 0=not started, 1=download test, 2=ping+jitter test, 3=upload test, 4=finished, 5=abort/error
var dlStatus = '' // download speed in megabit/s with 2 decimal digits
@goooseman
goooseman / .eslintrc
Created February 18, 2016 07:25
Meteor ESLint config example
{
"parserOptions": {
"ecmaVersion": 6
},
"env": {
"browser": true,
"meteor": true
},
"ecmaFeatures": {
"arrowFunctions": true,
@goooseman
goooseman / gist:5378021
Last active December 16, 2015 04:38
This code downloads a .torrent file from Russian torrent tracker rutracker.org, but this is a good example of downloading a file, which needs cookies and a "referer" header with NSURLConnection and NSData. All cookies are saved/loaded to/from system storage (that is used by Safari).
// RutrackerSimpleDownload
// Created by Alexander Gusev on 12.04.13.
// Copyright (c) 2013 Alexander Gusev. All rights reserved.
// http://goooseman.ru
// Variables //
NSString *username = @"";
NSString *password = @"";