Skip to content

Instantly share code, notes, and snippets.

View ianpaul's full-sized avatar
:bowtie:
Flashbake is ported!

Ian Paul ianpaul

:bowtie:
Flashbake is ported!
View GitHub Profile
@ianpaul
ianpaul / tmuxhelper.py
Last active May 20, 2022 16:06
A Python script to choose from your existing tmux sessions.
import subprocess
def pick_tmux():
print("Here are your active tmux sessions:\n")
s = subprocess.run(["tmux", "ls"], capture_output=True, text=True).stdout.strip("\n")
seshes = s.splitlines()
pretty_list = [s [:s.find(":")] for s in seshes]
put_numbers = enumerate(pretty_list, start=1)
menu_dict=dict((i,j) for i,j in put_numbers)
for key, value in menu_dict.items():
@ianpaul
ianpaul / goodbad.sh
Created June 6, 2021 07:23
Use a binary classification model on Hugging Face to determine whether a statement in English is positive or negative.
#!/bin/bash
read -p "Hello! Give me something to work with! A sentence or tweet will do. " sentence
# now let's do some curl magic
curl --fail --silent --show-error -X POST -H "Authorization: Bearer HUGGINGFACE_API_KEY" -H "Content-Type: application/json" -d '{"inputs": "'"$sentence"'"}' https://api-inference.huggingface.co/models/YOUR_USERNAME/PROJECT_URL | jq '.[0] | map(.) | if .[0].score < .[1].score then "positive" else "negative" end'
@ianpaul
ianpaul / pandoc-helper.sh
Created April 15, 2020 11:14
Convert markdown to HTML in Bash
#!/bin/bash
# A simple Bash script to create HTML in stdout from a markdown file
# This script requires pandoc. On Ubuntu use `sudo apt install pandoc` to install.
# Check to see if the user included a filename. If not, ask them for one.
if [ -z "$1" ]; then
read -p "Please provide a filename (include the path if not in this directory): " file
else file=$1
@ianpaul
ianpaul / Add_Existing_Git_Repo_to_GitHub.md
Last active March 24, 2017 18:29
Add existing Git repo to GitHub
  1. Create and initalize a new repo on GitHub without a ReadMe, license, or .gitignore
  2. Navigate to your local Git repo from the command line and carry out the following commands:
  3. git remote add origin [GitHub URL]
  4. git remote -v--this just verifies that the GitHub repo URL is valid
  5. git push -u origin master

Keybase proof

I hereby claim:

  • I am ianpaul on github.
  • I am ianpaul (https://keybase.io/ianpaul) on keybase.
  • I have a public key ASCzCID-CGNSYW7lwpflnxsJhdqoJD75KrjThjyb7R_ZQgo

To claim this, I am signing this object:

data:text/html, <body contenteditable style="font: 2rem/1.5 monospace;max-width:60rem;margin:0 auto;padding:4rem;">