Skip to content

Instantly share code, notes, and snippets.

View AMD-NICK's full-sized avatar
🏠
Working from home

_AMD_ AMD-NICK

🏠
Working from home
View GitHub Profile
@AMD-NICK
AMD-NICK / xor_search.lua
Last active October 27, 2017 00:24
Поиск отсутствующего числа в неотсортированной таблице
-- Для получения таблицы, типа {5,3,6,1,4,2,7} (1,7)
local function getArrayWithUniqueRandomNumbers(min,max)
local array = {}
local tmp = {} -- для расброса
for i = min,max do
table.insert(tmp,i)
end
repeat
@AMD-NICK
AMD-NICK / docker_run_transmission.sh
Created August 10, 2018 13:39
Docker Transmission Run Command
docker run --name=transmission \
-v $PWD/config:/config \
-v $PWD/downloads:/downloads \
-v $PWD/watch:/watch \
-e TZ=Europe/London \
-p 9091:9091 -p 51413:51413 \
-p 51413:51413/udp \
linuxserver/transmission
@AMD-NICK
AMD-NICK / git_perma_auth.md
Created August 12, 2018 15:42
Permanently authenticating with Git repositories

Run following command to enable credential caching:

$ git config credential.helper store
$ git push https://github.com/repo.git

Username for 'https://github.com': <USERNAME>
Password for 'https://USERNAME@github.com': <PASSWORD>
@AMD-NICK
AMD-NICK / tg-stafflist.md
Last active October 21, 2018 21:46
Архивный список персонала, который обновлялся до переезда сюда: staff.trigon.im
Имя ВК Ссылка ВК Ник на проекте Должности Стимайди Взял
Владислав Андреев https://vk.com/id232965381 _AMD_ Президент всея Тригон STEAM_0:1:55598730
Kostya Goncharov https://vk.com/id389663143 ZuZka Министр с начала времен STEAM_0:1:91686165
Гоша Печерских https://vk.com/id162848217 Megurine Luka САдмин STEAM_0:1:87134724
Антон Потапов https://vk.com/id185733246 Infernal Vogel Владелец Oberon'a, модератор на форуме, садмин РП STEAM_0:1:56347097
Никита Харц https://vk.com/id139954111 Dmitry.OS Заместитель президента STEAM_0:0:74582119
Даниил Белов https://vk.com/id197311666 +Raynor+ СА STEAM_0:1:13126402
Марк Марковкин https://vk.com/id87068963 Mark Markovkin Министр с 17.07.16 STEAM_1:1:82941854
Артем Гончаров https://vk.com/id176223031 Zauber Прокурор-судья с 03.11.16, Зам. Управляющего с 1.05.17 STEAM_0:0:156156287
@AMD-NICK
AMD-NICK / vgui.lua
Created October 4, 2015 19:20
[FREE] Gmod-Best New F4 Skin
local VoteVGUI = {}
local QuestionVGUI = {}
local PanelNum = 0
local LetterWritePanel
local t = "/vote"
local vt = "Голосование"
surface.CreateFont( "fontclose", { font = "Arial", size = 14, weight = 500, blursize = 0, scanlines = 0, antialias = true} )
surface.CreateFont( "logfond", { font = "Impact", size = 45, weight = 400, blursize = 0, scanlines = 0, antialias = true} )
@AMD-NICK
AMD-NICK / .gitignore
Created March 16, 2020 21:56
gitignore example for Garry's Mod servers. Excludes "highweight" files from uploading to repo. Special for https://blog.amd-nick.me/gmod-development
*.vmt
*.vtf
*.vmt
*.vtx
*.mdl
*.phy
*.vvd
*.mp3
*.ttf
*.wav
@AMD-NICK
AMD-NICK / hmac.lua
Created March 11, 2019 18:07
Попытка перенести github.com/user-none/lua-hashings в Garry's Mod. Начал с sha1, т.к. нужен был sha1.hmac, но нашел его здесь: https://qweqwe.ovh/gmod-sha1-hmac и забил
-- Copyright (c) 2016 John Schember <john@nachtimwald.com>
--
-- Permission is hereby granted, free of charge, to any person obtaining
-- a copy of this software and associated documentation files (the "Software"),
-- to deal in the Software without restriction, including without limitation
-- the rights to use, copy, modify, merge, publish, distribute, sublicense,
-- and/or sell copies of the Software, and to permit persons to whom the
-- Software is furnished to do so, subject to the following conditions:
--
-- The above copyright notice and this permission notice shall be included in
@AMD-NICK
AMD-NICK / install_gmod_dev.sh
Last active April 7, 2020 16:34
luadev + epoe + fprofiler install script
#/bin/bash
SERV_DIR=$HOME'/gm/path_to/garrysmod'
mkdir 'tmp'
cd 'tmp'
git clone 'https://github.com/Noiwex/luadev.git' luadev
git clone 'https://github.com/Metastruct/EPOE.git' epoe
git clone 'https://github.com/FPtje/FProfiler.git' fprofiler
@AMD-NICK
AMD-NICK / sv_singlewep.lua
Last active April 7, 2020 16:34
Скрипт, позволяющий настроить кол-во переносимого оружия конкретного типа. Легко модифицируется (например, без малейших проблем вы можете добавить возможность изменять лимиты пушек для конкретных проф или добавить новые группы, типа дробовиков) и очень легковесен. Здесь не используются тяжелые функции типа table.HasValue, а pairs с исключительны…
-- ██████╗ ██████╗ ██████╗ ███████╗██████╗ ██████╗ ██╗ ██╗ █████╗ ███╗ ███╗██████╗
-- ██╔════╝██╔═══██╗██╔══██╗██╔════╝██╔══██╗ ██╔══██╗╚██╗ ██╔╝ ██╔══██╗████╗ ████║██╔══██╗
-- ██║ ██║ ██║██║ ██║█████╗ ██║ ██║ ██████╔╝ ╚████╔╝ ███████║██╔████╔██║██║ ██║
-- ██║ ██║ ██║██║ ██║██╔══╝ ██║ ██║ ██╔══██╗ ╚██╔╝ ██╔══██║██║╚██╔╝██║██║ ██║
-- ╚██████╗╚██████╔╝██████╔╝███████╗██████╔╝ ██████╔╝ ██║ ███████╗██║ ██║██║ ╚═╝ ██║██████╔╝███████╗
-- ╚═════╝ ╚═════╝ ╚═════╝ ╚══════╝╚═════╝ ╚═════╝ ╚═╝ ╚══════╝╚═╝ ╚═╝╚═╝ ╚═╝╚═════╝ ╚══════╝
-- Скрипт в едином лице написан _AMD_ и принадлежит кодерам TRIGON.IM
-- Коммерческая реализация скрипта запрещена свободной лицензией Apache 2.0
-- Вы можете использовать скрипт на своих проектах бесплатно.
@AMD-NICK
AMD-NICK / telegram_to_csv.lua
Created December 31, 2020 03:07
Скрипт-конвертер лога Python скрипта с поста https://blog.amd-nick.me/telegram-online-chart/ в csv формат для Google Data Studio
local function parseRecord(str)
local psc = {str:match("^.(%d%d%d%d%-%d%d%-%d%d) @ (%d%d:%d%d:%d%d): User went (%w+)(.*)%.")}
if psc[4] then
local ts = dateToStamp(psc[1] .. " " .. psc[2]) + 3600 * 2
local online = psc[3] == "online"
local quick = #psc[4] > 0
return ts, online, quick
end
end