Skip to content

Instantly share code, notes, and snippets.

View jcsho's full-sized avatar

Justin Ho jcsho

  • EarthDaily Analytics
  • Vancouver, British Columbia
View GitHub Profile
  1. Setup Unity
  • Download Unity Hub and open it
  • Login to the hub using a Unity account (create one if you need)
  • Activate new personal license (select "I do not use Unity in a professional capacity")

@jcsho
jcsho / html-word-counter.py
Last active September 13, 2020 03:29
Returns sum of all words (excluding HTML entities) in an HTML file
# html-word-counter.py
# Returns sum of all words (excluding HTML entities) in an HTML file
import re
import urllib.request
# match anything between '<' and '>'
# TAG_ANY_RE = re.compile('<.*?>')
# match anything between '<' and '>' and HTML entities
TAG_ENT_RE = re.compile('<.*?>|&([a-z0-9]+|#[0-9]{1,6}|#x[0-9a-f]{1,6});')
# match anything between '<body' and '/body>'
public enum Direction {
UP,
DOWN,
LEFT,
RIGHT
}
@jcsho
jcsho / .git-commit-template.txt
Created June 12, 2019 19:54 — forked from adeekshith/.git-commit-template.txt
This commit message template helps you write great commit messages and enforce it across teams.
# <type>: (If applied, this commit will...) <subject> (Max 50 char)
# |<---- Using a Maximum Of 50 Characters ---->|
# Explain why this change is being made
# |<---- Try To Limit Each Line to a Maximum Of 72 Characters ---->|
# Provide links or keys to any relevant tickets, articles or other resources
# Example: Github issue #23
# hangman.py
# Instructions:
# 1. take in a letter
# 2. check if letter is in secret word
# 3. if letter is in secret word, print out position of letter in secret word
# 4. if letter is not in secret word, lose 1 health point and track the guess
import random
# get a random word from the file
# jeopardy.py
# Instructions - guess the secret word
secret_word = "face"
# print(secret_word)
# Take user's guess and store it into a variable
guess = input("Make a guess: ")
# Print out the user's guess
print("Your guess was: " + guess)
@jcsho
jcsho / PairCount.c
Created April 8, 2017 22:22
Takes in a file of words and outputs the probability of a pair of words occuring
//PairCount.c
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
static int wordCount = 0;
static int pairCount = 0;
int basicCount(FILE* basic) {
@jcsho
jcsho / Polynomial.h
Last active September 3, 2017 06:34
Short C++ code to overwrite operators for a single variable Polynomial class with underlying array
// Polynomial.h
/////////////////////////////////////////////////////////////////////////
//
// Student Info
// ------------
//
// Name : Justin Ho
// Email: justinhodev@gmail.com
//