Skip to content

Instantly share code, notes, and snippets.

View Naphier's full-sized avatar
🐲

Sean Mann Naphier

🐲
View GitHub Profile
@Naphier
Naphier / gmailer.py
Created March 7, 2023 23:21
Wrote this with the ChatGPT prompt "Write Python code to send email using GMail API and a Service Account". Looks accurate though I've not tested.
import os
import base64
import google.auth
from google.oauth2 import service_account
from googleapiclient.discovery import build
from googleapiclient.errors import HttpError
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart
from email.mime.image import MIMEImage
from email.mime.audio import MIMEAudio
@Naphier
Naphier / DebugNullRefIssue.cs
Created December 12, 2018 22:22
Test Case for Null Ref error in CoordinateSharp when using custom EagerLoad settings
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using CoordinateSharp;
using System.Diagnostics;
namespace CoordinateSharp_TestProj
{
@Naphier
Naphier / MapboxController.cs
Created July 31, 2018 13:07
MapboxController: AbstractMap Mapbox v1.3.0
/*
*
* VR Rehab, Inc Confidential
* __________________
*
* Copyright 2016 - VR Rehab, Inc
* All Rights Reserved.
*
* NOTICE: All information contained herein is, and remains
* the property of VR Rehab, Inc and its subsidiaries,
using UnityEngine;
using UnityEngine.Events;
using System.Threading;
using System.Collections;
public class SerialPortController : MonoBehaviour
{
protected Thread thread;
protected SerialThreadLines serialThread;
@Naphier
Naphier / InstallToAllAndroidDevices.cs
Last active May 20, 2017 23:45
Unity3D Editor Utility to install a built apk to multiple android devices.
using UnityEngine;
using UnityEditor;
using UnityEditor.Callbacks;
using System.IO;
using System.Diagnostics;
using System.Collections.Generic;
using System.Threading;
using Debug = UnityEngine.Debug;
@Naphier
Naphier / Mapbox.Unity.HTTPRequest.cs
Created May 4, 2017 13:28
Example static start and finish request callbacks
//-----------------------------------------------------------------------
// <copyright file="HTTPRequest.cs" company="Mapbox">
// Copyright (c) 2016 Mapbox. All rights reserved.
// </copyright>
//-----------------------------------------------------------------------
namespace Mapbox.Unity
{
using System;
using System.Collections;
@Naphier
Naphier / UGuiTextToTextMeshPro.cs
Created January 4, 2017 15:23
Unity3D Editor Tool to convert Unity GUI Text objects to Text Mesh Pro Text Objects
using UnityEngine;
using UnityEditor;
using UnityEngine.UI;
using TMPro;
using TMPro.EditorUtilities;
public class UGuiTextToTextMeshPro : Editor
{
[MenuItem("GameObject/UI/Convert To Text Mesh Pro", false, 4000)]
static void DoIt()
@Naphier
Naphier / Editor\MakeSpriteTexture.cs
Created November 21, 2016 21:20
Simple editor script that will create a 4x4 texture of the specified color. Useful for prototyping with sprites.
using UnityEngine;
using UnityEditor;
public class MakeSpriteTexture : EditorWindow
{
[MenuItem("Assets/Create Sprite")]
static void Init()
{
MakeSpriteTexture window = GetWindow<MakeSpriteTexture>("Create Sprite");
LICENSE SYSTEM [2016818 0:55:25] No start/stop license dates set
LICENSE SYSTEM [2016818 0:55:25] Next license update check is after 2016-08-07T20:46:52
Built from '5.3/patch-release' branch; Version is '5.3.4p5 (83b1f50dd5b8) revision 8630773'; Using compiler version '160040219'
OS: 'Windows 10 (10.0.0) 64bit' Language: 'en' Physical Memory: 16284 MB
BatchMode: 0, IsHumanControllingUs: 1, StartBugReporterOnCrash: 1, Is64bit: 1, IsPro: 0
Initialize mono
Mono path[0] = 'E:/Unity_5.3.4p5/Editor/Data/Managed'
@Naphier
Naphier / Vector3Ext.cs
Created May 4, 2016 16:42
Vector3 Multilerp (multiple lerps) for handline waypoints.
using System;
using UnityEngine;
namespace NG
{
public static class Vector3Ext
{
#region Multilerp
// This is not very optimized. There are at least n + 1 and at most 2n Vector3.Distance
// calls (where n is the number of waypoints).