Skip to content

Instantly share code, notes, and snippets.

View spajus's full-sized avatar
🌴
On vacation

Tomas Varaneckas spajus

🌴
On vacation
View GitHub Profile
@spajus
spajus / FPSHandbrake.cs
Last active May 14, 2020 10:59
Unity MonoBehaviour that stops the editor play mode before it's too late
using UnityEngine;
using UnityEngine.Profiling;
namespace KL.Utils {
public class FPSHandbrake : MonoBehaviour {
private float stopEditorAtFPS = 5;
private float memoryMaxMB = 1024 * 10;
private float stopEditorDelay = 10;
private float stopFrameDurationTreshold = 1;
@spajus
spajus / Missing.txt
Created May 4, 2020 13:28
BRS extra translations for v1.5.0
# New translations since v1.5.0
term.none,None
btn.extra,Extra
race.modifiers,Race Modifiers
race.select_challenge,Select Challenge
race.challenges,Challenges
race.challenge_target,Challenge Target
race.challenge_target.players,Players Only
race.challenge_target.everyone,Everyone
mission.type.none,None
@spajus
spajus / GameObjectMetadata.cs
Last active April 30, 2020 19:51
A component that tracks other Unity GameObject components, and reports when and what exactly is missing
using UnityEngine;
namespace KL.Utils.Behaviours {
[DefaultExecutionOrder(int.MinValue)]
[ExecuteInEditMode]
public class GameObjectMetadata : MonoBehaviour {
[SerializeField] private string[] components;
private void Start() {
@spajus
spajus / Description.txt
Last active April 23, 2020 15:18
Bloody Rally Show store page texts
Bloody Rally Show is dystopian roguelite combat racing game with infinite variety of race tracks, campaigns, missions, leaderboards, daily challenges, track editor, car editor, car tuning, customization, car battles, and multiple game modes, including one where you are a pedestrian.
// Put this file in Program Files\Adobe\Photoshop\Presets\Scripts\
// In PhotoShop menu File > Scripts > Layers To Sprite Sheet
// Arrange layers into a sprite sheet.
if (documents.length > 0) {
var docRef = activeDocument;
var numLayers = docRef.artLayers.length;
var cols = docRef.width;
ssh-dss AAAAB3NzaC1kc3MAAACBAIJ+UCYFJ1mKfFqORYzMYmid9DxBF3JMh8+1/qw06Y/Npi3Tjh11PDu2KXJeJ8TP3m/ZC0Tk8WgKpOE5ypMof+jq8KEmdan1qnln+b0pj4yOhNAn6QPx1PeON/ExaQWT4A5zuGUY0ozDPu6MiQ/P0AwYTXzo2obgO/2KeuO08JT3AAAAFQCLISGoMcdeXjfGHgNZRtsC+JAvkQAAAIBkDNadD8MepoLIHcK5/RfbdK8bKLb5z+WJYi6UNmevVLFK4BOq81qWqzN4k2Boe+XK6ZS8CadAHEypC52Nmp+6FXGcMGPJNONUdrzW0EfC5957ee93W5/qmScrBom0CTOtIK0Jz+0oO5h9dNkLI31hhaKc36Y/yQjdnh8epq4VyAAAAIAC0kIG8yLyc9lX21KXdh0myRcvtJhMiRRxnDbfwDkyciwicBMLpti5D8oXQ2OPOtQU3J+aNkL7efkZbkZqahtIhxbB31aTQhbF0YQO5ol6t+tIxWAgU36N5eQbN1GgHMpg/3ZX93rfreL0HBnQypwcUAHY6rxqzpxPzkUmUBib/A== tomasv
ssh-dss AAAAB3NzaC1kc3MAAACBAIJ+UCYFJ1mKfFqORYzMYmid9DxBF3JMh8+1/qw06Y/Npi3Tjh11PDu2KXJeJ8TP3m/ZC0Tk8WgKpOE5ypMof+jq8KEmdan1qnln+b0pj4yOhNAn6QPx1PeON/ExaQWT4A5zuGUY0ozDPu6MiQ/P0AwYTXzo2obgO/2KeuO08JT3AAAAFQCLISGoMcdeXjfGHgNZRtsC+JAvkQAAAIBkDNadD8MepoLIHcK5/RfbdK8bKLb5z+WJYi6UNmevVLFK4BOq81qWqzN4k2Boe+XK6ZS8CadAHEypC52Nmp+6FXGcMGPJNONUdrzW0EfC5957ee93W5/qmScrBom0CTOtIK0Jz+0oO5h9dNkLI31hhaKc36Y/yQjdnh8epq4VyAAAAIAC0kIG8yLyc9lX21KXdh0myRcvtJhMiRRxnDbfwDkyciwicBMLpti5D8oXQ2OPOtQU3J+aNkL7efkZbkZqahtIhxbB31aTQhbF0YQO5ol6t+tIxWAgU36N5eQbN1GgHMpg/3ZX93rfreL0HBnQypwcUAHY6rxqzpxPzkUmUBib/A== tomasv
@spajus
spajus / rake.txt
Created August 17, 2014 12:17
gosu ruby app
fatal error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/lipo: /Users/spajus/.rvm/rubies/ruby-2.1.2/lib/libruby.2.1.0.dylib and UniversalRuby/libruby.2.1.0.dylib have the same architectures (x86_64) and can't be in the same fat output file
rake aborted!
Command failed with status (1): [lipo /Users/spajus/.rvm/rubies/ruby-2.1.2/...]
/Users/spajus/GitHub/ruby_app/Rakefile:19:in `merge_lib'
/Users/spajus/GitHub/ruby_app/Rakefile:49:in `block in <top (required)>'
Tasks: TOP => default => merge_current_platform_into_universal_ruby
@spajus
spajus / arrays.rb
Last active August 29, 2015 14:04
Ruby benchmark: call a method on every object in array.
require 'benchmark'
class Something
def initialize(stuff)
@stuff = stuff
end
def update
@stuff += 0.1
end
end
stack level too deep
/Users/spajus/Dropbox/rubygamedev/manuscript/code/09-polishing/game_window.rb:11:in `update'
/Library/Ruby/Gems/2.0.0/gems/gosu-0.7.50/lib/gosu/swig_patches.rb:15:in `block (2 levels) in <class:Window>'
/Library/Ruby/Gems/2.0.0/gems/gosu-0.7.50/lib/gosu/swig_patches.rb:37:in `show'
/Library/Ruby/Gems/2.0.0/gems/gosu-0.7.50/lib/gosu/swig_patches.rb:37:in `show'
09-polishing/main.rb:28:in `<main>'