Skip to content

Instantly share code, notes, and snippets.

🌴
On vacation

Tomas Varaneckas spajus

🌴
On vacation
Block or report user

Report or block spajus

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@spajus
spajus / FPSHandbrake.cs
Last active May 14, 2020
Unity MonoBehaviour that stops the editor play mode before it's too late
View FPSHandbrake.cs
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
BRS extra translations for v1.5.0
View Missing.txt
# 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 Apr 30, 2020
A component that tracks other Unity GameObject components, and reports when and what exactly is missing
View GameObjectMetadata.cs
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 Apr 23, 2020
Bloody Rally Show store page texts
View Description.txt
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.
View Layers To Sprite Sheet.js
// 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;
View spajus.pub
ssh-dss AAAAB3NzaC1kc3MAAACBAIJ+UCYFJ1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QO5ol6t+tIxWAgU36N5eQbN1GgHMpg/3ZX93rfreL0HBnQypwcUAHY6rxqzpxPzkUmUBib/A== tomasv
@spajus
spajus / rake.txt
Created Aug 17, 2014
gosu ruby app
View rake.txt
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 Aug 29, 2015
Ruby benchmark: call a method on every object in array.
View arrays.rb
require 'benchmark'
class Something
def initialize(stuff)
@stuff = stuff
end
def update
@stuff += 0.1
end
end
View gist:d818a7c0e92800259252
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>'
You can’t perform that action at this time.