Skip to content

Instantly share code, notes, and snippets.

View xdegtyarev's full-sized avatar
🧊

Alexander Degtyarev xdegtyarev

🧊
View GitHub Profile
@xdegtyarev
xdegtyarev / .gitattributes
Last active February 22, 2021 11:35
LFS .gitattributes
# Sourcecode
*.txt diff
*.cs diff
*.json diff
*.meta diff
*.xml diff
# 3D models
*.3dm filter=lfs diff=lfs merge=lfs -text
*.3ds filter=lfs diff=lfs merge=lfs -text
*.blend filter=lfs diff=lfs merge=lfs -text
@xdegtyarev
xdegtyarev / FontResizeTest.cs
Last active September 25, 2018 12:26
Failed TextGeneratorTest
using UnityEngine;
using UnityEngine.TestTools;
using NUnit.Framework;
using System.Collections;
public class FontResizeTest {
[Test]
public void FontResizeTestSimplePasses() {
var settings = new TextGenerationSettings();
settings.textAnchor = TextAnchor.MiddleLeft;
Sequence toggleSequence = DOTween.Sequence().SetAutoKill();
toggleSequence.AppendCallback(()=>{sectorGO.SetActive(true);});
toggleSequence.AppendInterval(waitInterval);
toggleSequence.AppendCallback(()=>{sectorGO.SetActive(false);});
tell application "System Events"
tell process "Finder"
repeat 100 times
tell application "Finder" to open trash
tell application "Finder" to activate
key code 126
key down command
key code 51
key up command
delay 0.2 -- adjust delay as needed
const functions = require('firebase-functions');
const admin = require('firebase-admin');
admin.initializeApp(functions.config().firebase);
const tournamentOffsetInDays = 172800000;
exports.updateTournamentDate = functions.https.onRequest((request, response) => {
var tournamentRef = admin.database().ref("currentTournament");
var prevtournamentRef = admin.database().ref("prevTournament");
var fakeusersRef = admin.database().ref("fake_users");
public class WeightedSettings{
public string key;
public float weight;
public float reward;
}
public static string WeightedRandom(this List<WeightedSettings> list){
var totalChance = 0f;
foreach(var o in list){
totalChance += o.weight;
-> murder_scene
//
// System: items can have various states
// Some are general, some specific to particular items
//
LIST OffOn = off, on
LIST SeenUnseen = unseen, seen
#!/bin/sh
id=?
start=100000000
end=999999999
for (( n=$start; n<$end; n++ )); do
if (curl -s https://vk.com/doc"$id"_"$n" | grep -q "msg_back_button");
then
echo "$n" | tee grabber.out
else
startup, version: 3114 osx x64 channel: stable
executable: /Applications/Sublime Text.app/Contents/MacOS/Sublime Text
working dir: /
packages path: /Users/xdegtyarev/Library/Application Support/Sublime Text 3/Packages
state path: /Users/xdegtyarev/Library/Application Support/Sublime Text 3/Local
zip path: /Applications/Sublime Text.app/Contents/MacOS/Packages
zip path: /Users/xdegtyarev/Library/Application Support/Sublime Text 3/Installed Packages
ignored_packages: ["Vintage"]
pre session restore time: 0.421281
startup time: 0.471657
@xdegtyarev
xdegtyarev / Fast add child gameObject
Created October 31, 2013 21:31
Tiny Editor script, to create empty game object as a child to currently selected transform.
using UnityEngine;
using UnityEditor;
public class CreateEmptyChild : MonoBehaviour {
[MenuItem("GameObject/Create Empty Child &#n")]
static void EmptyChild(){
GameObject go = new GameObject("Empty");
go.transform.parent = Selection.activeTransform;
go.transform.localPosition = Vector3.zero;
go.transform.localRotation = Quaternion.identity;