Skip to content

Instantly share code, notes, and snippets.

🍰
Summer!

Peter Kos peterkos

🍰
Summer!
View GitHub Profile
View keybase.md

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 Apr 28, 2020
Lesson 3 func Solution.swift
View 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
CSE 340, Ex 1. Doodle - Snake
View SnakeDoodle.java
/*
* 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
Aperture Science luggage tag, for CSE 340
View science_luggage_tag.scad
// 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 Apr 21, 2019
1st order markov chain of the melody to "Mary Had A Little Lamb".
View markov1.swift
//
// main.swift
// MarkovTest
//
// Created by Peter Kos on 4/20/19.
// Copyright © 2019 UW. All rights reserved.
//
import Foundation
View everyotherarray.swift
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 Oct 17, 2018
Code written on Week 1 of the iOS Development Workshop, Autumn 2018, w/ Dubstech
View iosdev_dubstech_aut18_week1.swift
// -----------------------------------------
// Playground Code
// -----------------------------------------
import UIKit
var str = "Hello, playground"
// sayHello() prints "hello, person!"
@peterkos
peterkos / iosdev_dubstech_aut18_week0.swift
Created Oct 15, 2018
Code written on Week 0 of the iOS Development Workshop, Autumn 2018, w/ Dubstech
View iosdev_dubstech_aut18_week0.swift
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 Nov 27, 2017
On Canvas LMS, hides "correct/wrong" answer arrows to allow reviewing of quizzes without being influenced by answers
View canvasquizcover.css
.answer {
opacity: 1 !important;
}
.answer_arrow {
display: none;
}
.answer.wrong_answer {
border-top: 1px solid #ddd !important;
@peterkos
peterkos / PCBinaryTree.java
Created Apr 25, 2017
Binary tree with inorder traversal.
View PCBinaryTree.java
import static java.lang.System.*;
import java.util.ArrayList;
public class PCLegitBinaryTree {
public static void main(String[] args) {
You can’t perform that action at this time.