Skip to content

Instantly share code, notes, and snippets.

View alecvance's full-sized avatar

Alec Vance alecvance

View GitHub Profile
@ssshake
ssshake / isWrit
Last active September 29, 2023 06:15
Photon PUN Cheat Sheet
## Photon Methods
**public class Blank : Photon.PunBehaviour**
instead of mono behavior, use this to receive photon callbacks in your script.
**public override void OnLeftRoom()**
An example of overriding a punbehavior callback
@gunderson
gunderson / FlyCamera.cs
Last active May 10, 2024 12:53
Unity Script to give camera WASD + mouse control
using UnityEngine;
using System.Collections;
public class FlyCamera : MonoBehaviour {
/*
Writen by Windexglow 11-13-10. Use it, edit it, steal it I don't care.
Converted to C# 27-02-13 - no credit wanted.
Simple flycam I made, since I couldn't find any others made public.
Made simple to use (drag and drop, done) for regular keyboard layout
@stevenschobert
stevenschobert / load_remote_content_mail_dot_app.scpt
Last active January 12, 2022 11:19
Apple Script to click the "Load Remote Content" button. I like to disable all remote content in Mail.app, and then bind this script to a keyboard shortcut using Keyboard Maestro. https://www.keyboardmaestro.com
tell application "System Events" to tell process "Mail"
set mainWindow to a reference to the first window
set rootSplitter to a reference to the first splitter group of the mainWindow
set firstSplitter to a reference to the last splitter group of the rootSplitter
set scrollArea to a reference to the last scroll area of the firstSplitter
set scrollGroup to a reference to the first group of the scrollArea
if number of groups of the scrollGroup is greater than 1 then
set maybeRemoteContentGroup to a reference to the first group of the scrollGroup
@chriscdn
chriscdn / CLLocation+rhextensions.h
Last active August 17, 2018 07:23
A CLLocation category for determing the time zone from a location.
//
// CLLocation+rhextensions.h
//
// Copyright (C) 2015 by Christopher Meyer
// http://schwiiz.org/
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
@togakangaroo
togakangaroo / Presentation.cs
Created July 25, 2014 17:05
Demonstration of things you can do with inner classes
public class Presentation
{
public class PackageResult
{
public string Name;
public Stream Stream;
}
//PackageResult as an inner clas can be a good idea since its really just a Tuple and has no reusability value
public PackageResult Package()
{
@adamawolf
adamawolf / gist:3823502
Created October 2, 2012 21:44
How to print out a CGPathRef for debugging purposes
static void outputApplier(void* info, const CGPathElement* element)
{
NSMutableArray* a = (NSMutableArray*) info;
int nPoints;
NSString * pathElementType = nil;
switch (element->type)
{
case kCGPathElementMoveToPoint: