Skip to content

Instantly share code, notes, and snippets.

View jimmyhsu's full-sized avatar
💯
🐕

Jimmy Hsu jimmyhsu

💯
🐕
View GitHub Profile
@jimmyhsu
jimmyhsu / keybase-proof.md
Created November 19, 2019 07:51
Keybase Proof

Keybase proof

I hereby claim:

  • I am jimmyhsu on github.
  • I am jimmyhsu (https://keybase.io/jimmyhsu) on keybase.
  • I have a public key ASDtYmSDZOEKiJl07A3I7vPgZN37VV-2q53PO6MclToNOwo

To claim this, I am signing this object:

@jimmyhsu
jimmyhsu / tipcalc.swift
Last active February 25, 2017 22:27
Tip Calculator
@IBAction func calculateTip(_ sender: Any) {
guard let billAmount = Double(billAmountField.text!) else {
//show error
billAmountField.text = ""
tipAmountField.text = ""
totalAmountField.text = ""
return
}
var tipPercentage = 0.0
@jimmyhsu
jimmyhsu / findPeaks.js
Last active June 18, 2021 16:11
Find all the peaks in a given array
// NOTES: Prototypical Inheritance
// REQUIRE: lodash/underscore
// FUNCTION: Find all the peaks in a given array.
// USE: [1,2,3,2,1].findPeaks();
// INPUT: context/this
// RETURN: index, peak/value within array
// EX: [2,5]
// ERROR: false