Skip to content

Instantly share code, notes, and snippets.

View hartbeatnt's full-sized avatar

Nate Hart hartbeatnt

View GitHub Profile
@hartbeatnt
hartbeatnt / Loading elipsis animation.swift
Last active June 12, 2021 00:19 — forked from nunogoncalves/Loading elipsis animation.swift
Setting an ellipsis changing from 1 to 3 dots
let animationDelay = 0.5 // tweak this to speed up / slow down animation
var hiddenDots = 3
func animateDots() {
if let str = label.text {
let range = NSRange(location: str.count - hiddenDots, length: hiddenDots)
let string = NSMutableAttributedString(string: str)
string.addAttribute(.foregroundColor, value: UIColor.clear, range: range)
@hartbeatnt
hartbeatnt / checkpoint1.js
Created August 24, 2016 04:36
Nate Hart's Checkpoint 1
/*Write a function average that takes two numbers as input (parameters),
and returns the average of those numbers.*/
function average(num1, num2) {
return (num1 + num2) / 2;
}
/*Write a function greeter that takes a name as an argument and greets
that name by returning something along the lines of "Hello, <name>!"*/
/**
Pair Programming Practice. Submit a link to your gist here when you are done:
https://goo.gl/forms/mPumIHpIKF3W1gjt2
*/
/**
EXERCISE ONE
What is wrong with the following definitions of square? Write a sentence or two describing the issue(s); then,
try copying the erroneous examples into a console one-at-a-time and observing the error(s) generated (you may
have to attempt to invoke the functions to see the error). What errors are produced (if any) for each erroneous