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 / 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 / tipTaxFoodCalc.py
Created December 6, 2017 07:06
Tony Gaddis Python: Tip, Tax, Food
# Tip, Tax Food Calculator
# First Flowchart problem homework 1
# We will use 18% as the tip rate
TIP_PERCENTAGE = 0.18
# Currently the tax rate is 9%
TAX_PERCENTAGE = 0.09
charge_for_food = float(input('Input charge for food: '))
@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
@spaghettiSyntax
spaghettiSyntax / exercises1.sql
Created December 6, 2017 07:36
murach's SQL SERVER 2016: Exercises 1
--Exercise 1
SELECT VendorContactLName AS [Last Name]
, VendorContactFName AS [First Name]
, VendorName AS [Vendor]
FROM Vendors
ORDER BY VendorContactLName
, VendorContactFName; --Learned to use column numbers as ORDER BY's,
--but not recommended & Semi-Colon use will be
--required in future SQL Server editions so to
--get used to ending each statement with one.
@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 / 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 / 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 / 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 / windChill.py
Created December 6, 2017 08:18
Tony Gaddis Python: Wind Chill Table
# 11/13/17
# Wind chill values. Rows should represent windspeed from 10 to
# 60 mph inclusive in 5 mph increments. Columns should
# represent temperatures from -20 to 60 inclusive in
# 10-degree increments.
# Print x values of table.
print()
print('Wind Chill Table')
@spaghettiSyntax
spaghettiSyntax / compound.py
Created December 6, 2017 07:15
Tony Gaddis Python: Compound Interest
#ch_2_jrn_4
#Exercise 14
#This program calculates
#Compound Interest
print(' ')
print('Calculate compound interest by inputting values.')
print(' ')