Skip to content

Instantly share code, notes, and snippets.

Avatar
:octocat:

Tyler C TylerCode

:octocat:
View GitHub Profile
@TylerCode
TylerCode / GettingStartedWithNetworking.md
Last active Apr 30, 2019
Getting started with networking
View GettingStartedWithNetworking.md

UNITY

- Photon Networking:

This was actually where I started with networking. I'd say it's easy to use but I ultimately moved away from the platform due to the limited nature of the licensing. (I know, it's not really that limiting but to a younger me, it seemed that way) They have loads of features and different frameworks now and I'd say it's a pretty solid product.

@TylerCode
TylerCode / PowershellSelfElevation.ps1
Created Aug 24, 2018
Put this at the top of your script and it will self elevate
View PowershellSelfElevation.ps1
# Self-elevate the script if required
if (-Not ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] 'Administrator')) {
if ([int](Get-CimInstance -Class Win32_OperatingSystem | Select-Object -ExpandProperty BuildNumber) -ge 6000) {
$CommandLine = "-File `"" + $MyInvocation.MyCommand.Path + "`" " + $MyInvocation.UnboundArguments
Start-Process -FilePath PowerShell.exe -Verb Runas -ArgumentList $CommandLine
Exit
}
}
View LocalGravity.cs
using UnityEngine;
public class LocalGravity : MonoBehaviour
{
public Transform m_GravityCenter;
private Rigidbody m_RigidBody;
void Start()
{
View MySQLDatabaseDump.sh
#Linux shell file to dump all the databases into zipped archives.
#Can provide a version that dumps them to an Amazon S3 bucket.
user="root"
password="pass"
filename=$(date '+%Y-%m-%d-')WeeklyMYSQLBackup.tar.gz
echo -e "Starting Dump..."
# Get a list of the databases
View FindJobByStoredProcMultiServer.sql
--This script can connect to multiple servers, and try to find where a stored procedure is used
--I'll clean it up eventually and add a loop for this but for now I wanted to share what I had
--NOTE: You must turn on the SQLCMD command in SSMS to get this to work.
--This is done in Query > SQLCMDMode (Its just a toggle in the menu)
--Changes the connection in SSMS
:CONNECT Server01 --CHANGE THIS
go