Skip to content

Instantly share code, notes, and snippets.

View davidhariri's full-sized avatar

David Hariri davidhariri

View GitHub Profile
@davidhariri
davidhariri / daniels-principles.md
Last active June 2, 2022 00:58
Jack Daniels' principles for success in coaching runners

Five factors in success

  1. Ability - Shaq is a good basketball player, in part, because he's huge. Running factors (joint composition, aeorobic system) are more subtle.
  2. Motivation - Intrinisic motivation to be successful. A good why. Why do you want to be a runner? Only 15% have a good answer.
  3. Opportunity - Long distance running is not affected much by weather. Easier to run in colder climates than in hotter, humid conditions. Track distances is set by high school and universities.
  4. Direction - Coaching, a program, something that sets direction. Some direction is worse than none.
  5. Luck - Sometimes something happens in a race that gives a runner an opportunity.
  • The job of a coach is make an environment where maximum potential can be reached.
  • Run one lap at a time. If a lap is too long, try a step. Break it down into smaller segments.
  • Shake it up. Sometimes running a faster lap will feel better than a slower one.
  1. Nothing is perfect
  2. Strive for perfection
  3. As few dependencies as possible
  4. Test realistically
  5. Use objects for data validation
  6. Use functions for everything else
  7. Use typing features
@davidhariri
davidhariri / jwt-apple-signin.py
Created October 12, 2019 18:14
Code required to verify Sign in with app-made Apple JWT tokens server-side in Python
import jwt
from jwt.algorithms import RSAAlgorithm
import requests
from time import time
import json
import os
APPLE_PUBLIC_KEY_URL = "https://appleid.apple.com/auth/keys"
APPLE_PUBLIC_KEY = None
@davidhariri
davidhariri / LL-001.md
Last active April 19, 2018 15:19
First lunch and learn resources
@davidhariri
davidhariri / solver.py
Created November 15, 2017 16:29
HQ Trivia Solver
import os
import time
import crayons
import wikipedia
import nltk
import pytesseract
from PIL import Image, ImageEnhance
"""
@davidhariri
davidhariri / example.json
Last active September 19, 2017 02:25
Example Message
{
"by": "you",
"type": "text",
"body": "What is this brave new world?",
"external_id": "266328bd12194a4c17854cb0ca90",
"external_chat_id": "59bad655af87f90009ebb055"
}
@davidhariri
davidhariri / test.md
Created July 26, 2017 17:48
😀 😄 😁 ✅ ☺️ 😊

😀 😄 😁 ✅ ☺️ 😊

@davidhariri
davidhariri / baseball_fighters.py
Created May 9, 2017 16:35
Baseball Fighter Generator
import random
f_names = [
"Sleve",
"Onson",
"Darryl",
"Anatoli",
"Rey",
"Glenallen",
"Mario",
@davidhariri
davidhariri / fizzbuzz.swift
Created March 12, 2017 15:41
DRY-er FizzBuzz Solution in Swift
// Dry FizzBuzz solution for Swift 3 by David Hariri
// Made it for the Treehouse Swift Basics class
import Foundation
func isMultipleOf(n: Int, m: Int) -> Bool {
return n % m == 0
}
func fizzBuzz(n: Int) -> String {
class ModelStore(object):
def __init__(
self,
s3_id,
s3_key,
s3_bucket,
should_compress=True,
cache_expiry=180,
profile=False,
should_cache=True