Skip to content

Instantly share code, notes, and snippets.

View FREEZX's full-sized avatar

Kristijan Trajkovski FREEZX

View GitHub Profile
@FREEZX
FREEZX / AdvancedSyncStopwatch.cs
Last active October 21, 2024 11:00
FishNet Stopwatch that tries to account for client-server drift and only moves forward
#if FISHNET_STABLE_MODE
using FishNet.Documenting;
using FishNet.Managing.Timing;
using FishNet.Object.Synchronizing.Internal;
using FishNet.Serializing;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
namespace FishNet.Object.Synchronizing
{
@FREEZX
FREEZX / Unity + NEOVIM on Windows
Last active July 23, 2023 12:41
Windows Unity Neovim launcher
To use this, you need to have a neovim installation and neovide. In unity preferences, browse to the .bat file and set it as external script editor.
Here are the editor args needed to launch: `"$(ProjectPath)" $(File) $(Line)`
using System.Collections;
using System.Collections.Generic;
using FishNet;
using FishNet.Object;
using FishNet.Utility.Performance;
using UnityEngine;
public class ReproScript : NetworkBehaviour
{
public GameObject spawnObject;
using System.Collections;
using System.Collections.Generic;
using Doozy.Engine.UI.Base;
using Rewired;
using Sirenix.OdinInspector;
using UnityEngine;
public class RewiredToUIAction : MonoBehaviour
{
public UIAction Action;
@FREEZX
FREEZX / mailer.js
Last active January 23, 2020 23:40
import nodemailer from 'nodemailer';
import nodemailerMock from 'nodemailer-mock';
import config from './config';
/**
* Mailer config
*/
let transporter;
if(process.env.NODE_ENV === 'test') {
var viewer = new Cesium.Viewer('cesiumContainer');
var Nuke = function(){
var self = this;
this.degrees = [0, 0, 5000];
this.heading = 0;
this.pitch = Cesium.Math.toRadians(270);
this.roll = 0;
this.position = Cesium.Cartesian3.fromDegrees.apply(null, this.degrees);
var viewer = new Cesium.Viewer('cesiumContainer');
var Nuke = function(){
var self = this;
this.degrees = [0, 0, 5000];
this.heading = 0;
this.pitch = Cesium.Math.toRadians(270);
this.roll = 0;
this.position = Cesium.Cartesian3.fromDegrees.apply(null, this.degrees);
var async = require('async');
var benchtest = require('./' + process.argv[2]);
benchtest.prepareClient(parseInt(process.argv[4]), process.argv[3]);
console.log(JSON.stringify({message: 'start'}));
var sockets = parseInt(process.argv[5]);
var messages = parseInt(process.argv[6]);
var q = async.queue(function(task, callback){
@FREEZX
FREEZX / client.js
Created December 8, 2014 11:03
Benchmark primus
var async = require('async');
var benchtest = require('./' + process.argv[2]);
benchtest.prepareClient(parseInt(process.argv[4]), process.argv[3]);
console.log(JSON.stringify({message: 'start'}));
var sockets = parseInt(process.argv[5]);
var messages = parseInt(process.argv[6]);
var q = async.queue(function(task, callback){