Skip to content

Instantly share code, notes, and snippets.

View kurtkaiser's full-sized avatar

Kurt Kaiser kurtkaiser

View GitHub Profile
@kurtkaiser
kurtkaiser / subtractionAssembly.asm
Created April 23, 2019 01:35
Basic subtraction program, MASM, written for x86 processors
; Simple Calculator
; Kurt Kaiser
INCLUDE Irvine32.inc
; .data is used for declaring and defining variables
.data
codeTitle BYTE " --------- Math Magic --------- ", 0
directions BYTE "Enter 2 numbers.", 0
prompt1 BYTE "First number: ", 0
@kurtkaiser
kurtkaiser / assemblyAddition.asm
Created April 23, 2019 01:14
A simple addition program written in MASM, Assembly for x86 processors.
; Simple Calculator
; Kurt Kaiser
INCLUDE Irvine32.inc
; .data is used for declaring and defining variables
.data
num1 DWORD ?
num2 DWORD ?
codeTitle BYTE " --------- Math Magic --------- ", 0
directions BYTE "Enter 2 numbers.", 0
@kurtkaiser
kurtkaiser / findmedian.cpp
Last active April 8, 2019 22:33
Efficiently calculates and returns the median, as a double, of an array of integers
// Efficiently Calculates Median
// Kurt Kaiser
#include <iostream>
#include <algorithm>
using std::cout;
using std::endl;
// Defining a function to find the median of an array of ints,
// return type is double because median of ints can be decimals
double findMedian(int intArray[], int length) {
@kurtkaiser
kurtkaiser / Code.gs
Created March 17, 2019 20:21
Google Apps Script Email System with Full UI - Allows for multiple people to be alerted on a form submissions. The program has a full user interface, menu and a sidebar that save the options a user selects.
// UI Sheets Email Notifications
// Kurt Kaiser
// kurtkaiser.us
// All Rights Reserved, 2019
// Declare global variables
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getActiveSheet();
var lastRow = sheet.getLastRow();
var lastColumn = sheet.getLastColumn();
@kurtkaiser
kurtkaiser / How to Save a Property Video
Created February 16, 2019 19:55
Properties in Google Apps Script is confusing. At least it was for me. I honestly spent a year avoiding using properties, I found saving variables as properties very frustrating. I use properties often and wanted to make a quick introduction to how properties in Apps Script work.
// Kurt Kaiser
// kurtkaiser.us
// All Rights Reserved, 2019
var scriptProperties = PropertiesService.getScriptProperties();
function onOpen(){
var ui = SpreadsheetApp.getUi();
var response = ui.prompt('What is your favorite color?', ui.ButtonSet.OK);
scriptProperties.setProperty('color', response.getResponseText());
ui.alert('Favorite color: ' + scriptProperties.getProperty('color'));
@kurtkaiser
kurtkaiser / Code.gs
Created February 13, 2019 21:00
This code creates a sidebar in Google Apps Script, I wrote it as part of a tutorial video I filmed.
// Kurt Kaiser
// kurtkaiser.us
// Pretty Sidebar
// All rights reserved, 2019
function onOpen() {
var ui = SpreadsheetApp.getUi();
ui.createMenu('Tadah')
.addItem('Show Sidebar', 'showSidebar')
.addToUi();
@kurtkaiser
kurtkaiser / Video - Save Script and User Properties
Created February 12, 2019 00:30
I created this in a tutorial video on how to create script and user properties in Google Apps Script.
// Kurt Kaiser
// kurtkaiser.us
// All Right Reserved, 2019
var ui = SpreadsheetApp.getUi();
var scriptProperties = PropertiesService.getScriptProperties();
var userProperties = PropertiesService.getUserProperties();
function onOpen(){
ui.createMenu('Save a Property')
@kurtkaiser
kurtkaiser / Using Alerts in Google Apps Script
Created February 9, 2019 18:12
Google Apps Script can be intimidating at first. On of the early functions I needed to use was alerts. This is a simple program to show how to use an alert in Apps Script.
// Kurt Kaiser
// kurtkaiser.us
// All rights reserved, 2019
var ui = SpreadsheetApp.getUi();
function onOpen() {
ui.createMenu('Alert System')
.addItem('Alert Me!', 'showAlert')
.addToUi();
@kurtkaiser
kurtkaiser / codecombatgd1-17.py
Created February 2, 2019 16:49
This is the level I created for the final level of Code Code Combat Game Development 1, level 17. I made my level pretty challenging.
# Coded by Kurt Kaiser
player = game.spawnPlayerXY("samurai", 36, 30)
player.maxHealth = 5000
player.maxSpeed = 12
player.attackDamage = 20
game.addDefeatGoal()
game.spawnMaze("forest", 6)
ogreHome = game.spawnXY("generator", 25, 13)
ogreHome.spawnType = "ogre"
@kurtkaiser
kurtkaiser / emailsending.js
Last active January 16, 2019 00:16
Automatic Email Sending Add-on with Word Detection
// Word Based Email Alert System
// Kurt Kaiser, 2019
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getSheets()[0];
var lastRow = sheet.getLastRow();
var lastColumn = sheet.getLastColumn();
// Go through recent submission, check for alert word
function checkSubmission() {