Skip to content

Instantly share code, notes, and snippets.

@Holovin
Holovin / zerotier-ubuntu-gateway.md
Created May 5, 2023 14:45 — forked from tjelen/zerotier-ubuntu-gateway.md
Zerotier: Setting up the default gateway in Ubuntu Linux

Zerotier Ubuntu config notes

Setting up the default gateway (for VPN tunelling)

Ubuntu 18.04 UFW settings, based on [1] Step 1

  • ens3 .. primary physical ETH interface
  • 10.243.0.0/16 .. ZT network
@Holovin
Holovin / obs_twitch_chat.css
Created April 9, 2023 17:11 — forked from mjbogusz/obs_twitch_chat.css
Twitch chat transparent popout for OBS
/*
Twitch chat browsersource CSS for OBS
Just set the URL as https://www.twitch.tv/popout/%%TWITCHCHANNEL%%/chat
And paste this entire file into the CSS box
Original by twitch.tv/starvingpoet modified by github.com/Bluscream
Readjusted for new (2019/2020) Twitch by github.com/mjbogusz
General Settings
*/
body {
(*
Applescript to toggle between two sound outputs by Line number,
as they appear in the Sound Control Panel. Based on code by
Arthur Hammer http://apple.stackexchange.com/a/209434/85275
via https://apple.stackexchange.com/questions/217148/using-apple-script-to-manage-sound-output-selection
Модификация для русской MacOS
переменные output отсчитываются с единицы в окне
*)
// For use:
// 1) npm i telegraf got
// 2) replace TELEGRAM_BOT_TOKEN / YOUTUBE_TOKEN_API / YOUTUBE_VIDEO_ID / GROUP
const { Telegraf } = require('telegraf');
const got = require('got');
const URL = 'https://www.googleapis.com/youtube/v3/videos?id=YOUTUBE_VIDEO_ID&key=YOUTUBE_TOKEN_API&part=statistics';
const GROUP = -0; // telegram group ip, start with -, yes
const TOKEN = 'TELEGRAM_BOT_TOKEN';
@Holovin
Holovin / get_all_methods_of_object.py
Created July 16, 2017 21:07
Get all methods of object
print([method for method in dir(OBJECT) if callable(getattr(OBJECT, method))])
@Holovin
Holovin / jasmine_angular_timeout.js
Created July 10, 2017 08:27
Jasmine test: wait angular timeout
// flush timeout(s) for all code under test.
$timeout.flush();
// this will throw an exception if there are any pending timeouts.
$timeout.verifyNoPendingTasks();
@Holovin
Holovin / jasmine_date_mock.js
Created July 10, 2017 08:23
Jasmine unit test mock date
jasmine.clock().install();
var baseTime = new Date(2013, 9, 23);
jasmine.clock().mockDate(baseTime);
jasmine.clock().tick(50)
expect(new Date().getTime()).toEqual(baseTime.getTime() + 50);
afterEach(function () {
jasmine.clock().uninstall();
});