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
<?php | |
$HOST = "1.1.1.1"; | |
$DATABASE = "xxx"; | |
$USER = "xxx"; | |
$PASSWORD = "xxx"; | |
$TIMEOUT = 5; | |
$dsn = "mysql:host={$HOST};dbname={$DATABASE};charset=utf8"; | |
$opt = Array( |
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
function debug.Trace() | |
local level = 1 | |
Msg( "\nTrace:\n" ) | |
while true do | |
local info = debug.getinfo( level, "Sln" ) | |
if ( !info ) then break end |
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
-- parse markdown, its portable (can be used in any framework) | |
local markdown_data = markdown.parse("Hello **bold world!** I use *italic text*.") | |
-- returns: | |
{ | |
{ | |
body = "Hello ", | |
type = "raw" | |
}, | |
{ | |
body = "bold world!", |
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
-- Deprecated version, see https://github.com/Facepunch/garrysmod/pull/2033 for more details | |
-- Published for the archive | |
--[[--------------------------------------------------------- | |
table.Print | |
A better version of PrintTable | |
-----------------------------------------------------------]] | |
local tostringGmodTypes |
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
local function getKeys( tbl ) | |
local keys = {} | |
for k in pairs( tbl ) do | |
table.insert( keys, k ) | |
end | |
return keys |
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
local spline = math.BezierSpline( { | |
Vector( 128, 128 ), | |
Vector( 384, 128 ), | |
Vector( 128, 384 ) | |
} ) | |
hook.Add( "HUDPaint", "math.BezierSpline", function() | |
surface.SetDrawColor(255, 255, 0) | |
for i = 1, #spline - 1 do |
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
local points = { | |
Vector( 128, 128 ), | |
Vector( 384, 128 ), | |
Vector( 128, 384 ) | |
} | |
hook.Add( "HUDPaint", "math.BezierLerp", function() | |
local frac = RealTime() % 1 | |
local point = math.BezierLerp( frac, points ) |
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
--[[--------------------------------------------------------- | |
Name: BezierLerp( frac, points ) | |
Desc: Lerp point between points with bezier algorithms | |
-----------------------------------------------------------]] | |
function math.BezierLerp( frac, points ) | |
local mu = frac * frac | |
local mum = 1 - frac | |
local mum2 = mum * mum |
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
-- gmod vs srlion vs dash hook libs | |
-- to run this rename srlion & dash hook libs to hook_srlion & hook_dash | |
-- from incredible-gmod.ru with <3 | |
local function sum(tbl) | |
local out = 0 | |
for i = 1, #tbl do | |
out = out + tbl[i] | |
end |
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
return { | |
You = "Ты", | |
Yourself = "Себя", | |
Themself = "Себя", | |
Everyone = "Всех", | |
cant_use_as_console = "Вы должны быть игроком, чтобы использовать {S Red} команду!", | |
no_permission = "У вас нет разрешения на использование '{S Red}'!", | |
cant_target_multi_players = "Вы не можете настроить цель на нескольких игроков с помощью этой команды.!", |