Skip to content

Instantly share code, notes, and snippets.

View peterkos's full-sized avatar
:octocat:

Peter Kos peterkos

:octocat:
View GitHub Profile

Keybase proof

I hereby claim:

  • I am peterkos on github.
  • I am peterkoss (https://keybase.io/peterkoss) on keybase.
  • I have a public key ASDNZ1X061KSnznAanHxsQIEQpHBajCAYajHhhHs_-PUsAo

To claim this, I am signing this object:

@peterkos
peterkos / Lesson 3 func Solution.swift
Created April 28, 2020 20:41
Lesson 3 func Solution.swift
func add(num1: Int, num2: Int) -> Int {
return num1 + num2
}
let result = add(num1: 3, num2: 3)
print(result)
@peterkos
peterkos / SnakeDoodle.java
Created May 12, 2019 22:32
CSE 340, Ex 1. Doodle - Snake
/*
* RESOURCES:
* http://www.curious-creature.com/2013/12/21/android-recipe-4-path-tracing/
* (Implementation came from this SO link, however I derived something similar w/ ViewAnimator first)
* https://stackoverflow.com/questions/50674847/how-to-draw-several-lines-slowly-in-constant-velocity-on-canvas-by-android
* https://stackoverflow.com/questions/15010156/android-using-paint-to-draw-dashed-line-with-two-different-colors
*/
@peterkos
peterkos / science_luggage_tag.scad
Created May 2, 2019 17:25
Aperture Science luggage tag, for CSE 340
// rotate, translate, mirror (solid)
// union,
// difference (subtract shapes),
// hull (fills bounding box as tight as shape input)
// linear extrusion is a thing
// Inner triangle shape
@peterkos
peterkos / markov1.swift
Created April 21, 2019 07:54
1st order markov chain of the melody to "Mary Had A Little Lamb".
//
// main.swift
// MarkovTest
//
// Created by Peter Kos on 4/20/19.
// Copyright © 2019 UW. All rights reserved.
//
import Foundation
import UIKit
let array = [5, 16, 67, 2, 9]
// "Manual" way
for index in stride(from: 0, to: array.count, by: 2) {
print(array[index])
}
@peterkos
peterkos / iosdev_dubstech_aut18_week1.swift
Last active October 17, 2018 01:10
Code written on Week 1 of the iOS Development Workshop, Autumn 2018, w/ Dubstech
// -----------------------------------------
// Playground Code
// -----------------------------------------
import UIKit
var str = "Hello, playground"
// sayHello() prints "hello, person!"
@peterkos
peterkos / iosdev_dubstech_aut18_week0.swift
Created October 15, 2018 03:27
Code written on Week 0 of the iOS Development Workshop, Autumn 2018, w/ Dubstech
import UIKit
// var -- Variable (value can change)
// let -- Constant (value cannot change)
var str = "Hello, playground"
str = "My New String"
@peterkos
peterkos / canvasquizcover.css
Created November 27, 2017 03:07
On Canvas LMS, hides "correct/wrong" answer arrows to allow reviewing of quizzes without being influenced by answers
.answer {
opacity: 1 !important;
}
.answer_arrow {
display: none;
}
.answer.wrong_answer {
border-top: 1px solid #ddd !important;
@peterkos
peterkos / PCBinaryTree.java
Created April 25, 2017 17:41
Binary tree with inorder traversal.
import static java.lang.System.*;
import java.util.ArrayList;
public class PCLegitBinaryTree {
public static void main(String[] args) {