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
---Replaces %1, %2 and so on in the passed string of the passed arguments. | |
---@param str string # The string pattern contains %1 to %9. | |
---@param ... any # Any types will be passed to tostring. | |
---@return string str # New formated replaced string. | |
---@return integer count # Number of operations. | |
local stringformat = function(str, ...) | |
local tostring, select, gsub, t = tostring, select, string.gsub, {} | |
for i = 1, select('#', ...) do | |
t[tostring(i)] = tostring(select(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
pcall(require,"socket") | |
Scheduler = setmetatable({}, { | |
__call = function(class) | |
return setmetatable({ | |
threads = {}, | |
}, class) | |
end | |
}) | |
Scheduler.__index = Scheduler |
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
:8080 | |
# Points root onto remote's current working directory (as `caddy run` executed) | |
root * {os.Getwd} | |
# WebDAV access, requires custom Caddy build. | |
#@notget not method GET | |
#route @notget { | |
# webdav | |
#} |
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
@ECHO off | |
@SET PATH=%~dp0vendor\love-11.4-win32;%PATH% | |
@SET PATH=%~dp0vendor\love-11.4-win64;%PATH% | |
@love %~dp0game.love %* |
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
#!/usr/bin/env python | |
# Taken from http://zulko.github.io/blog/2015/02/01/extracting-perfectly-looping-gifs-from-videos-with-python-and-moviepy/ | |
import os | |
import sys | |
import moviepy.editor as mp | |
from moviepy.video.tools.cuts import FramesMatches | |
# Extends FramesMatches, the code is copied from source file then modified |
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
#!/bin/bash | |
# | |
# Script to convert MP4 video to GIF with generation of custom color palette. | |
# | |
#=== Do not touch code below | |
# Inner variables | |
input_file="" | |
input_fps="" | |
input_height="" |
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
-- Based on this: http://lua-users.org/wiki/LuaModulesLoader | |
module(..., package.seeall) | |
local function loader(modulename) | |
local errmsg = "" | |
local modulepath = string.gsub(modulename, "%.", "/") | |
local dirname = modulepath:match("(.*[/\\])") | |
local basename = modulepath:match("^.+/(.+)$") | |
for path in string.gmatch(package.path, "([^;]+)") do | |
local filename = string.gsub(path, "%?", table.concat({dirname, basename, "/", basename})) |
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
# Based on: https://shockbyte.com/billing/knowledgebase/154/Optimizing-bukkityml-to-Reduce-Lag.html | |
settings: | |
allow-end: true | |
warn-on-overload: true | |
permissions-file: permissions.yml | |
update-folder: update | |
plugin-profiling: false | |
connection-throttle: 4000 | |
query-plugins: true |
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 _Debug table for holding all variables | |
local _Debug = { | |
errors = {}, | |
prints = {}, | |
order = {}, --e for errors, p for prints | |
onTopFeed = {}, | |
orderOffset = 0, | |
longestOffset = 0, | |
drawOverlay = false, |
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
-- Might added functio comment later | |
local function alignPrint(text, x, y, ox, oy) | |
local font = love.graphics.getFont() | |
local h = { | |
0, | |
love.graphics.getWidth() / 2 - font:getWidth(text) / 2, | |
love.graphics.getWidth() - font:getWidth(text) | |
} |