Skip to content

Instantly share code, notes, and snippets.

View peterkos's full-sized avatar
:octocat:

Peter Kos peterkos

:octocat:
View GitHub Profile
# theme = "gruvbox_dark_hard"
# theme = "monokai_pro_octagon"
theme = "ayu_mirage"
[editor]
auto-completion = true
color-modes = true
bufferline = "always"
scroll-lines = 1
scrolloff = 15
@peterkos
peterkos / datefix.sh
Created September 25, 2023 00:47
music file organization scripts
#!/bin/fish
# Sets the created date of each directory
# to the date of its *oldest* contained file.
# rewritten from: https://stackoverflow.com/a/40173154/1431900
#
# ```
# dir_before/
# wow_song/ @ 1/3/20 <-----------| :^(
# wow_song v1.wav @ 1/1/20 <-|
@peterkos
peterkos / config.fish
Created August 29, 2022 18:10
All of my fish aliases :)
alias cl "osascript -e 'tell application \"System Events\" to keystroke \"k\" using command down'"
alias cls "clear && exa"
alias ls "exa"
alias lsl "ls -l"
alias lsa "ls -a"
alias lsal "ls -al"
alias c "clear"
alias rf "source ~/.config/fish/config.fish"
alias sub "subl" # am lazy
@peterkos
peterkos / codecounter.fish
Last active May 23, 2022 20:47
cumulative git sloc counter
git log --author="author" --pretty=tformat: --numstat | awk '{ add += $1; subs += $2; loc += $1 - $2 } END { printf "added lines: %s, removed lines: %s, total lines: %s\n", add, subs, loc }' -
@peterkos
peterkos / header.tex
Last active September 17, 2021 22:07
\documentclass{article}
\usepackage{sectsty}
\subsectionfont{\normalfont\fontsize{12}{10}\selectfont}
\usepackage{fancyhdr}
\pagestyle{myheadings}
\title{My Name \\ Assignment Title}
todo: write +^n in Swift
var i = 0
i++ // 1
i = 0
i++++ // 4
i = 0
i++++++++++++ // 12
var i = 0

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