Skip to content

Instantly share code, notes, and snippets.

View hunterhector's full-sized avatar

Hector hunterhector

  • Carnegie Mellon University
  • Pittsburgh
View GitHub Profile
# code_block.py
#
# This script analyzes the source files with some markers to find
# the line numbers of the code blocks, and then uses markdown-autodoc
# to generate markdown files with the code blocks. One difference
# from using markdown-autodoc directly is that one don't have to
# hardcode the line numbers so can somehow feel free to modify the
# source code.
#
# Usage: python code_block.py [markdown input] [markdown out] [source code]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
# Install first
# conda create --name forte python=3.9 pip
# pip install forte
# pip install forte.nltk
# pip install forte.spacy
# if you want to use it in the notebook
# pip install jupyter lab
# Find our medium blog at: medium.com/casl-project/
@hunterhector
hunterhector / ontology.json
Created June 13, 2020 03:53
Reproducing stave annotation bug
{
"name": "all_ontology",
"definitions": [
{
"entry_name": "ft.onto.base_ontology.Token",
"parent_entry": "forte.data.ontology.top.Annotation",
"description": "A span based annotation :class:`Token`, used to represent a token or a word.",
"attributes": [
{
"name": "pos",
@hunterhector
hunterhector / rescue_pie.py
Last active April 30, 2022 20:44
Present RescueTime's productivity output as a pie chart, could be used in stuff like geektools.
import json
import urllib.request
import urllib.parse
import sys
import datetime
import os
output_dir = sys.argv[1]
apikey = sys.argv[2]
@hunterhector
hunterhector / terminal_emoticon
Last active September 16, 2020 17:50
Add Emoticons to terminal
# Save each emoticon in a line at the EMOFILE location below
# I use this gist : https://gist.github.com/hunterhector/7458898
# Add the following to your .bash_profile to get random emoticons in your bash prompt.
# This works for Mac, change gsort to sort on general Linux distributions.
# Config Emoticon for PS1
export EMOFILE=~/.dotfiles/emoticons
export UCOLOR="\[\033[1;34m\]"
export WCOLOR="\[\033[1;39m\]"
@hunterhector
hunterhector / regexPrime.py
Created November 15, 2014 17:19
Regex Prime
#!/usr/bin/python
import re
def regex_prime(n):
l = "1" * n
return re.match(r"^1?$|^(11+?)\1+$", l) == None
while True:
n = raw_input("\nEnter a number and test for prime:")
try:
@hunterhector
hunterhector / emoticons
Last active November 9, 2022 04:18 — forked from Digo/emoticons
I used these emoticons to decorate my bash via this script: https://gist.github.com/hunterhector/e8befc2d0bfe636bee56
(´・ω・`)
(˘❥˘)
(・ิω・ิ)
(。▰‿‿▰。) ❤
( ・ิω・ิ)ノิ
Z(∩3∩)Z
o( ̄ヘ ̄o#).
╰(*°▽°*)╯
ʅ(‾◡◝)ʃ
ʕ •ᴥ•ʔ