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 = "Вы не можете настроить цель на нескольких игроков с помощью этой команды.!", |
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 BlendColor(a, b, frac) | |
| return a * (1 - frac) + b * frac | |
| end | |
| -- simple blending example | |
| do | |
| local red = Color(192, 57, 43) | |
| local blue = Color(41, 128, 185) | |
| hook.Add("HUDPaint", "color blending cycle", function() |
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
| // удаляет всю музыку из вашей библиотеки https://vk.com/audio | |
| // ни одно из решений в интернете не работало, пришлось написать свой скрипт | |
| var songs = document.querySelector("#content > div > div._audio_page_content_block_wrap.audio_page_content_block_wrap > div.audio_page_sections._audio_page_sections.clear_fix > div.audio_section._audio_section._audio_section__all.audio_section__all.clear_fix.audio_w_covers > div > div:nth-child(2) > div.CatalogSection__columns > div.CatalogSection__leftColumn.CatalogSection__paginatedBlocks > div.CatalogBlock__content.CatalogBlock__my_audios.CatalogBlock__layout--list > div > div > div.audio_page__rows_wrap > div > div.CatalogBlock__itemsContainer.audio_page__audio_rows_list._audio_page__audio_rows_list._audio_pl.audio_w_covers.CatalogBlock__itemsContainer--reorderable"); | |
| var list = songs.querySelectorAll(".audio_row"); | |
| console.log(`Total songs: ${list.length}`); | |
| list.forEach(function(elem) { | |
| let obj = AudioUtils.getAudioFromEl(elem); | |
| let data_audio = JSON.parse(elem. |