Skip to content

Instantly share code, notes, and snippets.

View spaghettiSyntax's full-sized avatar
🏠
Working from home

spaghettiSyntax spaghettiSyntax

🏠
Working from home
View GitHub Profile
@spaghettiSyntax
spaghettiSyntax / ExcelToWordTemplate.vba
Created March 12, 2020 01:47
An excel to word transfer script.
Option Explicit
Const SOURCE_PATH = "C:\[REMOVED BEFORE GITHUB]\"
Const EMAIL_SOURCE_PATH = "C:\[REMOVED BEFORE GITHUB]"
Const DESTINATION_PATH = "C:\[REMOVED BEFORE GITHUB]\"
Const TEMPLATE_PATH = "C:\[REMOVED BEFORE GITHUB]"
Sub ActivateWordTransferData()
'==========================================='
@spaghettiSyntax
spaghettiSyntax / 2DUnityScreenShake.cs
Created March 12, 2020 01:37
A simple 2D screen shake built in Unity.
using UnityEngine;
public class ScreenShakeController : MonoBehaviour
{
// This is a singleton
public static ScreenShakeController _instance;
public float shakeTimeRemaining = 1f;
private float shakePower = 0.5f;
private float shakeFadeTime;
@spaghettiSyntax
spaghettiSyntax / Item.cs
Last active January 31, 2020 19:00
Item
using UnityEngine;
public class Item : MonoBehaviour
{
[Header("Item Type")]
public bool isItem;
public bool isWeapon;
public bool isArmor;
[Header("Item Details")]
@spaghettiSyntax
spaghettiSyntax / BattleManager.cs
Last active January 31, 2020 19:11
Battle Manager
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.SceneManagement;
using Random = UnityEngine.Random;
using System;
public class BattleManager : MonoBehaviour
{
@spaghettiSyntax
spaghettiSyntax / CameraController.cs
Created December 20, 2019 22:36
Clamping Custom Camera
// OrthographicSize gets the height of the camera
halfHeight = Camera.main.orthographicSize;
// .aspect == aspect ratio on the screen
halfWidth = halfHeight * Camera.main.aspect;
bottomLeftLimit = tileMap.localBounds.min + new Vector3(halfWidth, halfHeight, 0f);
topRightLimit = tileMap.localBounds.max + new Vector3(-halfWidth, -halfHeight, 0f);
// LateUpdate is called after Update also once per frame
@spaghettiSyntax
spaghettiSyntax / Bug-Template
Created September 24, 2018 20:22
Bug-Template
#### Issue description
#### Steps to reproduce the issue
1.
2.
3.
{
"files":[
"typescript/main.ts",
"typescript/ToDoItem.ts"
],
"compilerOptions": {
"removeComments": true,
"outFile": "scripts/code.js",
"target": "es5",
"watch": true
@spaghettiSyntax
spaghettiSyntax / SwallowedAFlySong.java
Created January 5, 2018 05:37
java/SwallowedAFlySong
// Assignment: Write a program that prints the lyrics to:
// "There Was an Old Lady Who Swallowed a Fly."
// This is Programming Project 3 of Chapter 1 of Building Java Programs.
public class SwallowedAFlySong {
public static void main( String[] args) {
// Animal verses that the Old Lady swallowed.
flyVerse();
spiderVerse();
birdVerse();
@spaghettiSyntax
spaghettiSyntax / guitarShop2.sql
Created December 7, 2017 07:24
murach's SQL SERVER 2016: Guitar Shop
/*
Ch. 4 Guitar Shop
10/11/17
*/
/*
Exercise: 1 (COMPLETE)
Write a SELECT statement that joins the Categories table to the Products table and returns these columns:
CategoryName, ProductName, ListPrice
Sort the result set by CategoryName and then by ProductName in ASC order.
@spaghettiSyntax
spaghettiSyntax / joinQueries.sql
Last active May 23, 2020 19:10
murach's SQL SERVER 2016: Join Queries
--Chapter 4 Join Queries
--10/10/17
/*
Exercise 1 (COMPLETE)
Write a SELECT statement that returns all columns from the Vendors table
inner-joined with the Invoices table
*/
SELECT *
FROM Vendors INNER