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
using UnityEngine;
namespace KL.Utils {
public class LoadPrefab : MonoBehaviour {
#pragma warning disable 0649
[SerializeField] private GameObject prefab;
[SerializeField] private bool inEditor = true;
[SerializeField] private bool inRuntime = true;
#pragma warning restore 0649
@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.
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
Index: configure.ac
===================================================================
--- configure.ac (revision 13700)
+++ configure.ac (working copy)
@@ -346,6 +346,12 @@
DEFAULT_SUPP="darwin12.supp ${DEFAULT_SUPP}"
DEFAULT_SUPP="darwin10-drd.supp ${DEFAULT_SUPP}"
;;
+ 13.*)
+ AC_MSG_RESULT([Darwin 12.x (${kernel}) / Mac OS X 10.8 Mountain Lion])
vars = Object.methods
Benchmark.realtime { 100000.times { vars.map { |var| var.to_s } } }
=> 2.04459
Benchmark.realtime { 100000.times { vars.map { |var| var.to_s } } }
=> 2.048889
Benchmark.realtime { 100000.times { vars.map(&:to_s) } }
=> 1.917303
Benchmark.realtime { 100000.times { vars.map(&:to_s) } }
=> 1.944543
{ "action": "closed", "number": 1, "pull_request": { "_links": { "comments": { "href": "https://api.github.com/repos/spajus/dailyscripts/issues/1/comments" }, "html": { "href": "https://github.com/spajus/dailyscripts/pull/1" }, "issue": { "href": "https://api.github.com/repos/spajus/dailyscripts/issues/1" }, "review_comments": { "href": "https://api.github.com/repos/spajus/dailyscripts/pulls/1/comments" }, "self": { "href": "https://api.github.com/repos/spajus/dailyscripts/pulls/1" } }, "additions": 6, "assignee": null, "base": { "label": "spajus:master", "ref": "master", "repo": { "archive_url": "https://api.github.com/repos/spajus/dailyscripts/{archive_format}{/ref}", "assignees_url": "https://api.github.com/repos/spajus/dailyscripts/assignees{/user}", "blobs_url": "https://api.github.com/repos/spajus/dailyscripts/git/blobs{/sha}", "branches_url": "https://api.github.com/repos/spajus/dailyscripts/branches{/branch}", "clone_url": "https://github.com/spajus/dailyscripts.git", "collaborators_url": "https://api
@spajus
spajus / gist:5213420
Created March 21, 2013 14:26
delete all git tags locally and remotely with exclusion list
for t in `git tag`
do
arr=("keep_this" "keep_that" "and this")
if [[ "${arr[@]}" =~ ${t} ]]; then
echo keeping $t
else
git push origin :$t
git tag -d $t
fi
done