Skip to content

Instantly share code, notes, and snippets.

View Lerg's full-sized avatar

Sergey Lerg Lerg

View GitHub Profile
--[[
A simple sample game for Corona SDK.
http://coronalabs.com
Made by @SergeyLerg.
Licence: MIT.
]]
-- Don't show pesky status bar.
display.setStatusBar(display.HiddenStatusBar)
@Lerg
Lerg / random_desktop_image.scpt
Last active February 5, 2023 20:57
macOS AppleScript to set the same random picture as a desktop background on all monitors. Pictures are taken from the `~\Pictures` directory.
tell application "Finder"
set randomimage to some file of folder ((path to home folder as string) & "Pictures") as string
end tell
tell application "System Events"
tell every desktop
set random order to false
set picture to randomimage
end tell
end tell
@Lerg
Lerg / n28s.lua
Last active December 2, 2022 16:43
Script wrapper for Defold
local hashed = require('libs.hashed')
local _M = {}
local scripts = {}
-- NoMoreGlobalFunctionsInScripts
function _M.new()
local script = {
@Lerg
Lerg / tasks.json
Last active July 7, 2023 22:29
"Jai: Build & Run" - VS Code task for building and running a Jai program
{
"version": "2.0.0",
"tasks": [
{
"type": "shell",
"label": "Jai: Build & Run",
"command": "jai -quiet ${file} && ${fileDirname}${pathSeparator}${fileBasenameNoExtension}",
"group": "build",
"presentation": {
"revealProblems": "onProblem",
@Lerg
Lerg / LambdaTimer.cs
Created February 2, 2024 12:52
Timer with a lambda function execution on timeout for Godot 3
using Godot;
using System;
/*
var timer = new LambdaTimer(() => GD.Print("hello timer!"));
AddChild(timer);
*/
public class LambdaTimer : Timer {
private Action onTimeOutAction { get; }