This file contains 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
// This code is distributed under the Unlicense license. | |
// For more details, please visit https://unlicense.org/ | |
template <class T> | |
class CircularBuffer | |
{ | |
private: | |
std::unique_ptr<T[]> buffer; | |
size_t frontIndex; | |
size_t backIndex; |
This file contains 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 formatString(inputString) | |
local outputString = "" | |
for line in inputString:gmatch("[^\r\n]+") do | |
if line:match("%S") then -- Check if row is empty | |
local formattedLine = line:gsub("^%s*", "") -- Remove spaces before the first character of the line |
This file contains 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
<?xml version="1.0" encoding="utf-8"?> | |
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:tools="http://schemas.android.com/tools"> | |
<uses-feature android:glEsVersion="0x00020000" android:required="true" /> | |
<!-- Add this for apps targeting Android 13 or higher & GMA SDK version 20.3.0 or lower --> | |
<uses-permission android:name="com.google.android.gms.permission.AD_ID"/> | |
<application> |
This file contains 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 lg = love.graphics | |
local Display = { | |
size = { | |
w = 0, | |
h = 0, | |
ox = 0, | |
oy = 0 | |
}; |
This file contains 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
require("table-partition.lua") | |
do -- Dividing a table with a length of 167 into 7 tables | |
local TBL = {} | |
for i = 1, 167 do TBL[i] = i end | |
local TBLS = table.partition(TBL, 7) |
This file contains 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 parse = require "moonscript.parse" | |
local compile = require "moonscript.compile" | |
local function getLine(msg) | |
io.write(msg or "> ") | |
return io.read("*l") | |
end | |
local function getChoice(msg, ...) |
This file contains 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 timeTest = function(f, ...) | |
local t1, r, t2 = os.clock(), f(...), os.clock() | |
print(string.format("The function took %0.6f seconds to run", t2 - t1)) | |
return r | |
end | |
return timeTest |