Skip to content

Instantly share code, notes, and snippets.

Jen Kagan kaganjd

Block or report user

Report or block kaganjd

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View spencer-followers.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View baldwin.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View baldwin-spencer.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View p5-tern.md

Generating a Tern.js defs file for p5.js

Goal

p5 source code --> YUIDoc JSON --> Tern defs JSON

Process

Because p5.js uses YUIDoc to generate documentation, I'm using @angelozerr's tern.yuidoc plugin to generate a Tern.js defs file for p5.js. Ultimately, this will be used to implement code hints and autocomplete in the p5.js web editor.

  1. Get the p5.js API JSON file from the p5 website, here. Learn more about the p5.js API JSON file here.
  2. Then, get the Tern defs generator. Clone @angelozerr's repo with $ git clone https://github.com/angelozerr/tern.yuidoc
View autocomplete-todos.md

Bugs

  • Get existing cm.setOption calls to work with the Tern cm.setOption calls
  • Figure out how to link tern.yuidoc as a dependency of p5 so a Grunt task can be created/run to create the Tern definition file each time there are updates
  • Autocomplete is only triggered with a .
  • Suuuper sluggish performance when multiple functions/vars/words register with Tern. Hard to tell whether this is Tern or CodeMirror show-hint

Functionality to add

  • Modal window that describes Tern keys (like existing keyboard shortcuts modal)
  • Toggle/keyboard shortcut to turn on Tern stuff
    • probably in "Settings: General" (see new Jerel design on Zeplin)
@kaganjd
kaganjd / awscli.sh
Created Feb 21, 2018
Set up a virtualenv for AWSCLI with Python3
View awscli.sh
mkdir test-python
cd test-python/
virtualenv -p /Library/Frameworks/Python.framework/Versions/3.6/bin/python3 test-python
source test-python/bin/activate
pip3 install awscli --upgrade
View keybase.md

Keybase proof

I hereby claim:

  • I am kaganjd on github.
  • I am kaganjd (https://keybase.io/kaganjd) on keybase.
  • I have a public key ASB_WW7N8fS4VHy6Dz0Pbn3-IA4B0kcU3c5Ljkldt7xhlAo

To claim this, I am signing this object:

@kaganjd
kaganjd / get_keys.py
Created Jul 10, 2019
Python script to get a GitHub user's public SSH keys and write to .ssh/authorized_keys
View get_keys.py
# Run with `python3 get_keys.py [user]`
import requests
import subprocess
import argparse
parser = argparse.ArgumentParser()
parser.add_argument("user")
args = parser.parse_args()
You can’t perform that action at this time.